我越来越
{"type":"bad_request","message":"Unexpected token }"}
从更新Webhooks
端点。我正在尝试在 asp.net 中实现这一点。我的代码块如下:
var httpCLient = new HttpClient();
httpCLient.BaseAddress = new Uri("https://connect.squareup.com");
AuthenticationHeaderValue auth = new AuthenticationHeaderValue("Bearer", "access_token");
httpCLient.DefaultRequestHeaders.Authorization = auth;
httpCLient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpContent content = new StringContent("{\"PAYMENT_UPDATED\"}", System.Text.Encoding.UTF8, "application/json");
Task<HttpResponseMessage> httpResponse = httpCLient.PutAsync("/v1/me/webhooks", content);
if (httpResponse.Result.StatusCode == HttpStatusCode.OK)
{
}
谁能帮我这个?我已经在 Google 上搜索了任何连接 API 实施指南/示例,但没有运气。