2
  var client = new HttpClient();

            HttpRequestMessage httpRequestMessage = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://api.stubhubsandbox.com/login"),

            };

            httpRequestMessage.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("text/html"));
            httpRequestMessage.Headers.Add("Host", "api.stubhubsandbox.com");
            httpRequestMessage.Content = new StringContent(finalParameters);

            httpRequestMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(ContentType);
            httpRequestMessage.Content.Headers.ContentLength = 80;
            httpRequestMessage.Headers.Add("Authorization", Authorization);


            Console.WriteLine(httpRequestMessage.ToString());

            var response = client.SendAsync(httpRequestMessage).ContinueWith(respTask =>
            {
                Console.WriteLine("Response: {0}", respTask.Result);
            });

            Console.ReadLine();

我打开了我的提琴手,但我没有看到我的请求已发送。它没有返回或抛出任何异常?看起来我无法通过 https 调用我的调用?

4

0 回答 0