第 5 步:更改目标端点
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面适用于 Apigee 和 Apigee Hybrid。
查看 Apigee Edge 文档。
将代理的目标端点更改为返回更有意义的数据的端点。
- 在 Apigee 部分中展开 helloworld API 代理软件包,然后点击 targets 文件夹中的 default.xml,以在编辑器中打开该文件。
- 更新
<URL>
元素,以将 xml 附加到现有网址,如下所示:<TargetEndpoint name="default">
<HTTPTargetConnection>
<URL>https://mocktarget.apigee.net/xml</URL>
</HTTPTargetConnection>
</TargetEndpoint>
- 选择 File > Save 或 ⌘S 保存修改。
- 如需重新部署环境,请将光标放在 Apigee 部分中的 dev 环境文件夹上,然后点击 。
- 当系统提示您选择要导出的测试软件包时,请点击在不使用测试软件包的情况下部署,因为测试软件包已导出。
- 在 Terminal 标签页中运行 API。
curl 0:8998/helloworld?apikey=ZQA5euYtNeJ7ZCGCJMpvd6F2BZOmxOzY
返回以下响应:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<city>San Jose</city>
<firstName>John</firstName>
<lastName>Doe</lastName>
<state>CA</state>
</root>
在下一步中,您将向 API 添加新政策。
下一步
1
2
3
4
5
(下一步)第 6 步:附加政策
7
8
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-09。
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]