1
我用c#编写的代码wcf服务。它调用第三方支付API。在wcf中的响应错误c#API
string requestBody = "{ \"cardToken\":\"xxxxx\", \"expiryDate\":\"xxxx\",\"cvv\":\"xxx\",\"amount\":\"xxx\" }";
string data = Newtonsoft.Json.JsonConvert.SerializeObject(requestBody);
var content = new StringContent(data, Encoding.UTF8, "application/json");
HttpResponseMessage responseDebitAPI = client.PostAsync("http://example.com/example/api/payments/debit?access_token=xxxxxxxxxxxxxx", content).Result;
呼叫我得到下面的错误API后:
{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Date: Tue, 20 Jun 2017 08:04:59 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Content-Length: 1011
Content-Language: en
Content-Type: text/html; charset=utf-8
}}
请帮我在上面的代码,如果我做错了。
谢谢大卫... –
不客气。 – David