In UPS OAuth API integration, we are getting a timeout on API response. When we try a request with CURL, we are getting a http 302 successful response. But in RestSharp / C#, we get timeout.
C# code:
var restClient = new RestClient("https://onlinetools.ups.com/security/v1/oauth/authorize");
var request = new RestRequest(Method.GET);
request.AddQueryParameter("client_id", "MyclientId");
request.AddQueryParameter("redirect_uri", "https://local.myclient.com/Seller/Carrier/UpsOAuthCallback");
request.AddQueryParameter("response_type", "code");
request.AddQueryParameter("scope", "read");
request.AddQueryParameter("state", "superstate");
request.AddQueryParameter("code_challenge", "boxes2021");
var response = await restClient.ExecuteAsync(request);
CURL command:
curl -v -i -X GET 'https://onlinetools.ups.com/security/v1/oauth/authorize?client_id=MyclientId&redirect_uri=https://local.myclient.com/Seller/Carrier/UpsOAuthCallback&response_type=code&state=superstate&scope=read&code_challenge=boxes@2021'
I've tried a code block for OAuth and I got timeout. But when I tried the request with CURL in the terminal, I got a successful response.