Skip to content

HTTPClient::PATCH missing #2830

Closed
Closed
@Heizelmann

Description

@Heizelmann

Because HTTPClient::PATCH is missing in the library
I tried it with the basic function sendRequest(), but then I get an connection refused error.

HTTPClient httpClient;
httpClient.begin(url);
httpClient.setAuthorization(PIMATIC_USER, PIMATIC_PWD);
int httpCode = httpClient.sendRequest("PATCH", content);
  if (httpCode > 0) {
    Serial.printf("[HTTP] PATCH... code: %d\n", httpCode);
  } else {
    Serial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(httpCode).c_str());
  }
  httpClient.end();

For comparison a low level solution with WiFiClient works on same server.

WiFiClient client;
...
client.print("PATCH " + url + " HTTP/1.1\r\n" +
               "Authorization: Basic " + unameenc + "\r\n" +
               "Host: " + HOST_IP + "\r\n" +
               "Content-Type: application/json" + "\r\n" +
               "Content-Length: " + content.length() + "\r\n\r\n" +
               content);

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions