Expedia API book.api.ean.com空白

时间:2012-03-30 18:45:31

标签: php xml json rest

我想用expedia api预订酒店

https://book.api.ean.com/

但网址始终为空白

使用rest / json

详细说明

http://developer.ean.com/docs/hotels/version_3/book_reservation/

我见过一些人遇到同样的问题,并想知道是否有人知道它是什么

https://book.api.ean.com/ean-services/rs/hotel/v3/res?cid=55505 &安培; apiKey = XXX &安培;语言环境= EN_US &安培; CURRENCYCODE = USD & customerUserAgent = Mozilla / 5.0(Windows NT 6.1)AppleWebKit / 535.11(KHTML,与Gecko一样)Chrome / 17.0.963.83 Safari / 535.11 &安培; customerIpAddress = 127.0.0.1 &安培; ROOM1 = 1,3 &安培; room1FirstName = TestBooking &安培; room1LastName = TestBooking &安培; room1BedTypeId = 13 &安培; room1SmokingPreference = NS &安培;房间2 = 1,5 &安培; room2FirstName = TestBooking &安培; room2LastName = TestBooking &安培; room2BedTypeId = 13 &安培; room2SmokingPreference = NS &安培;电子邮件= XXX &安培;的firstName = TestBooking &安培; lastName的= TestBooking &安培; HOMEPHONE = TestBooking &安培;办公电话= TestBooking &安培; CREDITCARDTYPE = CA &安培; creditCardNumber = 5401999999999999 &安培; creditCardIdentifier = 123 &安培; creditCardExpirationMonth = 11 &安培; creditCardExpirationYear = 2012 &安培;地址1 =的Travel &安培;城市=贝尔维尤 &安培; stateProvinceCode = WA &安培; COUNTRYCODE = US &安培;邮编= 98004 &安培; customerSessionId = 0ABAA871-3127-A913-6642-A1F86D902E2B &安培; hotelId = 211540 &安培; arrivalDate = 12/10/2012年 &安培; departureDate = 12/12/2012年 &安培; supplierType = E &安培; rateKey = d03a8d29-1df2-4436-81d6-6b37eb4dcb78 &安培; roomTypeCode = 352749 &安培; rateCode = 1279169 &安培; chargeableRate = 803.04

包括或排除minorrev似乎没有多大区别

1 个答案:

答案 0 :(得分:2)

尝试urlencoding每个querystring参数:

customerUserAgent=Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.83 Safari/535.11

arrivalDate=12/10/2012

customerUserAgent url param应该是url编码的:

customerUserAgent=Mozilla%2F5.0%20(Windows%20NT%206.1)%20AppleWebKit%2F535.11%20(KHTML%2C%20like%20Gecko)%20Chrome%2F17.0.963.83%20Safari%2F535.11

arrivalDate=12%2F10%2F2012

有关详细信息,请查看PHP的urlencode

另外,请务必删除每个查询字符串参数之间的空格,不确定它是否是复制/粘贴问题。