本文介绍了Expedia API book.api.ean.com空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用expedia api预订酒店

Im looking to book a hotel with expedia api

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

但网址始终为空

在这里使用rest/json详细显示

details here using rest/json

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

我看到一些人也遇到同样的问题,想知道是否有人知道这是什么

I've seen a few people experiencing the same problem and wondered if anyone knew what it was

https://book.api. ean.com/ean-services/rs/hotel/v3/res?cid=55505 & apiKey = xxx& locale = zh_CN& currencyCode =美元& customerUserAgent = Mozilla/5.0(Windows NT 6.1)AppleWebKit/535.11(KHTML,like 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& room2 = 1,5& room2FirstName = TestBooking& room2LastName = TestBooking& room2BedTypeId = 13& room2SmokingPreference = NS& email = xxx& firstName = TestBooking& lastName = TestBooking& homePhone =测试预订& workPhone =测试预订& creditCardType = CA& creditCardNumber = 5401999999999999& creditCardIdentifier = 123& creditCardExpirationMonth = 11& creditCardExpirationYear = 2012& address1 = travelnow& city = Bellevue& stateProvinceCode = WA& countryCode =美国& postalCode = 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

https://book.api.ean.com/ean-services/rs/hotel/v3/res?cid=55505&apiKey=xxx&locale=en_US&currencyCode=USD&customerUserAgent=Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like 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&room2=1,5&room2FirstName=TestBooking&room2LastName=TestBooking&room2BedTypeId=13&room2SmokingPreference=NS&email=xxx&firstName=TestBooking&lastName=TestBooking&homePhone=TestBooking&workPhone=TestBooking&creditCardType=CA&creditCardNumber=5401999999999999&creditCardIdentifier=123&creditCardExpirationMonth=11&creditCardExpirationYear=2012&address1=travelnow&city=Bellevue&stateProvinceCode=WA&countryCode=US&postalCode=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似乎并没有多大作用

including or excluding the minorrev doesn't seem to make much difference

推荐答案

尝试对每个查询字符串参数进行urlencoding:

Try urlencoding each querystring parameter:

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参数应为url编码:

The customerUserAgent url param should be url encoded:

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 .

Take a look at PHP's urlencode for more information.

此外,请确保删除每个查询字符串参数之间的空格,不确定是否存在复制/粘贴问题.

Also, be sure to remove the spaces between each querystring param, not sure if it was copy/paste issue or not.

这篇关于Expedia API book.api.ean.com空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 06:02