Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Im looking to book a hotel with expedia api

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

but the url is always blank,

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=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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
395 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...