URLConnection PUT successful but not

I have an api call to update an entity in an app using a PUT. The response is a 200 but the update does not work. I am using similar code for GETs with no issues. Any guidance would be appreciated.

Running on a MAC M2

Var Conn11 As New ProdURL
Var url As String = “https://app.prod.com/api/v1/client/08c57588-dc85-4b21-a3e7-5b4617437d55
Var content As String

Conn11.RequestHeader(“Authorization”) = “Bearer " + App.dict.Value(“bearer”)
Conn11.RequestHeader(“Content-Type”) = “application/json”
Conn11.DataType = “JSON”
Conn11.DataContent = “{”“is_enable””:true}"
content = Conn11.SendSync(“PUT”, url, 3)

MessageBox(content + “-” + Conn11.HTTPStatusCode.ToString)

I’m not familiar with the .DataType and .DataContent properties of the URLConnection.

You probably want the SetRequestContent method:

Conn11.SetRequestContent("{""is_enabl"":true}", "application/json")
1 Like

That did it I had tried that earlier and it did not work. I must have had a typo. Thank you for the input. I am still learning about APIs but making progress.

Thank you!