Open BarryDuggan opened 1 year ago
For anybody else that comes lands here from google, the correct way to write the PUT request is
putClient.beginRequest();
putClient.put(endpoint);
putClient.sendHeader("Content-Type", "application/json");
putClient.sendHeader("Authorization", "Basic abc");
putClient.sendHeader("Content-Length", String(jsonString.length()));
putClient.beginBody();
putClient.print(jsonString);
putClient.endRequest();
So I'm making requests to a server that requires an Authorisation header.
I can successfully call the GET endpoints setting the auth header.
GET REQUEST
When I attempt a PUT request however I get a 401 status
PUT REQUEST
I've verified that the auth token is correct using postman. Could somebody help me figure out why setting the auth header for GET works fine but doesnt work for PUT?