Step 5: Change the target endpoint

You're viewing Apigee X documentation.
View Apigee Edge documentation.

Change your proxy's target endpoint to one that returns more meaningful data.

  1. Expand the helloworld API proxy bundle in the Apigee Explorer and click default.xml in the targets folder to open the file in the editor.

    default.xml target endpoint file in Apigee Explorer

  2. Update the <URL> element to append xml to the existing URL, as shown below:
    <TargetEndpoint name="default">
      <HTTPTargetConnection>
         <URL>https://mocktarget.apigee.net/xml</URL>
      </HTTPTargetConnection>
    </TargetEndpoint>
  3. Select File > Save or ⌘S to save your edits.
  4. To redeploy the environment, position your cursor over the dev environment folder in the Apigee Explorer and click Deploy icon.

    Deploy icon displays when you position the cursor over dev environment folder

  5. Run your API in the Terminal tab.
    curl localhost:8998/helloworld?apikey=ZQA5euYtNeJ7ZCGCJMpvd6F2BZOmxOzY

    The following response is returned:

    <?xml version="1.0" encoding="UTF-8"?>
      <root>
        <city>San Jose</city>
        <firstName>John</firstName>
        <lastName>Doe</lastName>
        <state>CA</state>
      </root>
    

In the next step, you'll add a new policy to your API.

Next step

1 2 3 4 5 (NEXT) Step 6: Attach a policy 7 8