Skip to content

Method PATCH and DELETE #150

Description

@BogdanovAleksei

It is impossible to implement standard HTTP / 1.1 PATCH in the standard library version. Maybe I'm confusing something and you can use PUT, but this is not quite RESTful.

When using the DELETE method with any body, the client does not receive a response from the server, as time passes, the answer comes: Error: Server returned nothing (no headers, no data)

const std::shared_ptr<httpserver::http_response>
source_resource::render_DELETE(const httpserver::http_request &req)
{
  httpserver::string_response* response = new httpserver::string_response("{\"result\":\"ok\"}", 200);
  response->with_header("Content-Type","application/json");
  return std::shared_ptr<httpserver::http_response>(response);                         
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to libhttpserver's public APIs.bugConfirmed bugs or reports that are very likely to be bugs.feature-requestFeature requests or enhancements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions