简体   繁体   中英

API Timeout error with HttpWebRequest C# | wroking with postman and restsharp

I am trying to make apiAPI(Expedia API for Hotel booking) with URL https://test.ean.com/2.1/itineraries?token= using C# HttpWebRequest and every time its return time out error

I'm trying to send request using RestSharp some time it works , when I use PostMan or soap UI there are no problem but when I do it with code using HttpWebRequest I got error like

{"The operation has timed out"}

I am using below header to execute API

Accept-Encoding gzip
Authorization EAN apikey=3dsc5rp4ae3hit69plc0m0af1g,signature=BFA4B8F006B99D40D693C48EC213371247D13A27850ED00ECFC23567123FD27FB1259D34DF50D240E1B99308821B758187CEA2DDF531B8D47F2B257768C89A07,timestamp=1547040437
Customer-Ip 192.168.1.1
User-Agent  Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Test standard
accept application/json

Can any one please help me to resolve time out error with HttpwebReuqest

Thank you in advance

I got alternative solution, Using RestStarp Version 105.2.3 its working fine. Older version of restsharp was not consistence but new version is working fine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM