mardi 14 février 2017

C# JSON POST request to server always fails with "405 method not allowed"

I am trying to send a JSON to a authentication server. It supports POST requests but it does not work. This is currently my code:

 Using client = New WebClient()
        client.Headers(HttpRequestHeader.ProxyAuthorization) = ""
        client.Headers(HttpRequestHeader.ContentType) = "application/json"
        result = client.UploadString("authserver link here", "POST", json)
 End Using

The error it returns is "405 Method not allowed". What is causing that issue? My JSON is properly formatted, and the server works.

Aucun commentaire:

Enregistrer un commentaire