Code: Select all
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(BaseURL + "reports/1.0/");
httpClient.DefaultRequestHeaders.Add("consumerKey", ConsumerKey);
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("sessionToken ", ott);
httpClient.DefaultRequestHeaders.Add("User-Agent", "PostmanRuntime/7.29.0");
httpClient.DefaultRequestHeaders.Add("Accept-Encoding", "gzip, deflate, br");
httpClient.DefaultRequestHeaders.Add("Connection", "keep-alive");
httpClient.DefaultRequestHeaders.Add("Accept", "*/*");
var response = await httpClient.GetAsync("orders");
response.EnsureSuccessStatusCode();
Gleiche Anforderung aus dem Rohprotokoll von Postman < /p>
Code: Select all
GET /apim/reports/1.0/orders HTTP/1.1
consumerKey: L3UnAkofqNfW0rhgtYUz7UQzN58a
sessionToken: DA05DA9F178D8C0E5754F03E617A49546330776ABFDDBC
Accept: application/xml
Authorization: Bearer 6971ce62-789e-3b1b-b805-82560f1f21c6
Postman-Token: 04df336c-9226-4eab-8054-c004940e4660
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=15768000; includeSubDomains
Access-Control-Expose-Headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Timestamp: 46
Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content- Type,SOAPAction,consumerKey,sessionToken,Authorization
Content-Type: application/json
Date: Sun, 22 May 2022 10:57:28 GMT
Transfer-Encoding: chunked
< /code>
Die fehlerhafte Anforderung von Visual Studio scheint 200 im Fiddler zu haben! Im Folgenden finden Sie die Antwort der in Fiddler erfassten fehlgeschlagenen Anfrage. < /P>
HTTP/1.1 200 Connection Established
FiddlerGateway: Direct
StartTime: 18:13:22.888
Connection: close
This is a CONNECT tunnel, through which encrypted HTTPS traffic flows.
To view the encrypted sessions inside this tunnel, enable the Tools > Options > HTTPS > Decrypt HTTPS traffic option.
A SSLv3-compatible ServerHello handshake was found. Fiddler extracted the parameters below.
Alle Vorschläge darüber, was das Problem sein kann oder wie ich die Fehlerbehebung von großer Hilfe sein kann! Bitte beraten Sie.