0

我在下面有以下代码,但它没有完成。我能说的最好的是 JSON 不正确,但我不知道如何到达那里。任何帮助,将不胜感激。当我运行它时,它告诉我 400 Bad Request。

    Dim Client As New RestSharp.RestClient("https://connect.squareup.com")
    Dim Request As New RestSharp.RestRequest("v1/" & MERCHANTID & "/categories", RestSharp.Method.POST)
    Request.RequestFormat = RestSharp.DataFormat.Json
    Request.AddHeader("Authorization", "Bearer " & ACCESS_TOKEN)
    Request.AddHeader("Accept", "application/json")
    Request.AddHeader("Content-Type", "application/json")

    Request.AddParameter("name", "Milkshake")

    Dim response As RestSharp.RestResponse = Client.Execute(Request)
    Dim getresponse As String = response.StatusCode
4

0 回答 0