站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
预订宝/getRegions
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
==示例代码== 以下示例代码是通过HTML表单实现了该接口的部分操作,您在开发过程中应当使用自己的平台语言来模拟这些操作以捕获响应体,然后对响应体做出相应的操作。 请求示例: <pre> <!-- 这是该接口的请求示例,该接口的访问类同于如下表单的提交, 请注意:该表单使用控件的方法模拟了GET请求 --> <form id="myForm" method="get" action="http://api.yudingbao.net/v1.0/hotel/geospatials.ashx"> <p> <!--动作标识,注意动作标识是大小写敏感的--> <input id="act" name="act" value="getRegions" type="text" /> </p> <p> <!--指定响应结果应包含行政区数据--> <input id="includeDistricts" name="withDistricts" value="true" type="text" /> <!--指定响应结果应包含商业区数据--> <input id="includeCommercials" name="withCommercials" value="true" type="text" /> <!--指定响应结果应包含著名地标数据--> <input id="includeLandmarks" name="withLandmarks" value="true" type="text" /> </p> <p> <!--指定响应格式为XML,这里以XML为例--> <input id="format" name="format" value="xml" type="text" /> <!--指定响应体应当是已格式化的,便于阅读代码,在生产环境中应当将该值设置为false--> <input id="indent" name="indent" value="true" type="text" /> <!--产品编号。在我的账户-分销产品的应用列表中可以找到该参数的值。--> <input id="aid" name="aid" value="78663" type="text" /> <!--接口密钥。在我的账户-分销产品的应用列表中可以找到该参数的值。--> <input id="key" name="key" value="0925ed633d24577eb3ffe13f00c55a4f9739f51a77eefb1dba29bb9568acddfd" type="text" /> <!--应用程序授权编号及公钥,这是可选的--> <input id="sid" name="sid" value="" type="text"> <input id="sKey" name="sKey" value="" type="text"> </p> <p> <input id="submit" name="submit" value="提交" type="submit"> </p> </form> </pre> JsonP响应: <pre> // JsonP响应,响应体过大,已删节 jsoncallback({ "Status" : 0, "Messages" : [], "ResponseBody" : [{ "Code" : "1", "Name" : "华北", "Pinyin" : "Hua Bei", "Provinces" : [{ "Code" : "0100", "Name" : "北京", "Pinyin" : "Bei Jing", "Cities" : [{ "Code" : "0101", "Name" : "北京", "Pinyin" : "", "TotalHotels" : 1388, "DistrictLocations" : [{ "Code" : "0001", "Name" : "西城区", "Pinyin" : "" }, { "Code" : "0033", "Name" : "大兴区", "Pinyin" : "" }], "CommercialLocations" : [{ "Code" : "010101", "Name" : "国贸CBD", "Pinyin" : "" }, { "Code" : "010102", "Name" : "燕莎/农展馆", "Pinyin" : "" }], "LandmarkLocations" : [{ "Code" : "0005", "Name" : "东方广场", "Pinyin" : "" }, { "Code" : "0006", "Name" : "中国国际展览中心", "Pinyin" : "" }] }] }, { "Code" : "8", "Name" : "港澳台", "Pinyin" : "Gang Ao Tai", "Provinces" : [{ "Code" : "3201", "Name" : "香港", "Pinyin" : "Xiang Gang", "Cities" : [] }, { "Code" : "3301", "Name" : "澳门", "Pinyin" : "Ao Men", "Cities" : [] }, { "Code" : "9001", "Name" : "台湾", "Pinyin" : "TaiWan", "Cities" : [] }] }] }); </pre> Json响应: <pre> // Json响应,响应体过大,已删节 { "Status" : 0, "Messages" : [], "ResponseBody" : [{ "Code" : "1", "Name" : "华北", "Pinyin" : "Hua Bei", "Provinces" : [{ "Code" : "0100", "Name" : "北京", "Pinyin" : "Bei Jing", "Cities" : [{ "Code" : "0101", "Name" : "北京", "Pinyin" : "", "TotalHotels" : 1388, "DistrictLocations" : [{ "Code" : "0001", "Name" : "西城区", "Pinyin" : "" }, { "Code" : "0033", "Name" : "大兴区", "Pinyin" : "" }], "CommercialLocations" : [{ "Code" : "010101", "Name" : "国贸CBD", "Pinyin" : "" }, { "Code" : "010102", "Name" : "燕莎/农展馆", "Pinyin" : "" }], "LandmarkLocations" : [{ "Code" : "0005", "Name" : "东方广场", "Pinyin" : "" }, { "Code" : "0006", "Name" : "中国国际展览中心", "Pinyin" : "" }] }] }, { "Code" : "8", "Name" : "港澳台", "Pinyin" : "Gang Ao Tai", "Provinces" : [{ "Code" : "3201", "Name" : "香港", "Pinyin" : "Xiang Gang", "Cities" : [] }, { "Code" : "3301", "Name" : "澳门", "Pinyin" : "Ao Men", "Cities" : [] }, { "Code" : "9001", "Name" : "台湾", "Pinyin" : "TaiWan", "Cities" : [] }] }] } </pre> XML响应: <pre> <!--XML响应,响应体过大,已删节--> <?xml version="1.0" encoding="utf-8"?> <HttpResponse> <Status type="number">0</Status> <Messages type="array"> </Messages> <ResponseBody type="array"> <item type="object"> <Code type="string">1</Code> <Name type="string">华北</Name> <Pinyin type="string">Hua Bei</Pinyin> <Provinces type="array"> <item type="object"> <Code type="string">0100</Code> <Name type="string">北京</Name> <Pinyin type="string">Bei Jing</Pinyin> <Cities type="array"> <item type="object"> <Code type="string">0101</Code> <Name type="string">北京</Name> <Pinyin type="string"> </Pinyin> <TotalHotels type="number">1388</TotalHotels> <DistrictLocations type="array"> <item type="object"> <Code type="string">0001</Code> <Name type="string">西城区</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> <Code type="string">0002</Code> <Name type="string">东城区</Name> <Pinyin type="string"> </Pinyin> </item> </DistrictLocations> <CommercialLocations type="array"> <item type="object"> <Code type="string">010101</Code> <Name type="string">国贸CBD</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> <Code type="string">010102</Code> <Name type="string">燕莎/农展馆</Name> <Pinyin type="string"> </Pinyin> </item> </CommercialLocations> <LandmarkLocations type="array"> <item type="object"> <Code type="string">0005</Code> <Name type="string">东方广场</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> <Code type="string">0006</Code> <Name type="string">中国国际展览中心</Name> <Pinyin type="string"> </Pinyin> </item> </LandmarkLocations> </item> </Cities> </item> <item type="object"> <Code type="string">0700</Code> <Name type="string">内蒙古</Name> <Pinyin type="string">Nei Meng Gu</Pinyin> <Cities type="array"> <item type="object"> <Code type="string">0701</Code> <Name type="string">呼和浩特</Name> <Pinyin type="string"> </Pinyin> <TotalHotels type="number">91</TotalHotels> <DistrictLocations type="array"> <item type="object"> <Code type="string">0000</Code> <Name type="string">不详</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> <Code type="string">0010</Code> <Name type="string">土默特左旗</Name> <Pinyin type="string"> </Pinyin> </item> </DistrictLocations> <CommercialLocations type="array"> <item type="object"> <Code type="string">070101</Code> <Name type="string">满都海公园</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> <Code type="string">070110</Code> <Name type="string">青山公园</Name> <Pinyin type="string"> </Pinyin> </item> </CommercialLocations> <LandmarkLocations type="array"> <item type="object"> <Code type="string">0001</Code> <Name type="string">王府井百货(回民区)</Name> <Pinyin type="string"> </Pinyin> </item> <item type="object"> </LandmarkLocations> </item> <item type="object"> <Code type="string">0722</Code> <Name type="string">乌拉特中旗</Name> <Pinyin type="string"> </Pinyin> <TotalHotels type="number">0</TotalHotels> <DistrictLocations type="array"> <item type="object"> <Code type="string">0001</Code> <Name type="string">县中心</Name> <Pinyin type="string"> </Pinyin> </item> </DistrictLocations> <CommercialLocations type="array"> </CommercialLocations> <LandmarkLocations type="array"> </LandmarkLocations> </item> </Cities> </item> </Provinces> </item> <item type="object"> <Code type="string">8</Code> <Name type="string">港澳台</Name> <Pinyin type="string">Gang Ao Tai</Pinyin> <Provinces type="array"> <item type="object"> <Code type="string">3201</Code> <Name type="string">香港</Name> <Pinyin type="string">Xiang Gang</Pinyin> <Cities type="array"> </Cities> </item> <item type="object"> <Code type="string">3301</Code> <Name type="string">澳门</Name> <Pinyin type="string">Ao Men</Pinyin> <Cities type="array"> </Cities> </item> <item type="object"> <Code type="string">9001</Code> <Name type="string">台湾</Name> <Pinyin type="string">TaiWan</Pinyin> <Cities type="array"> </Cities> </item> </Provinces> </item> </ResponseBody> </HttpResponse> </pre>
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)