You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The HTTP Server currently only supports GET and POST methods as seen in http_server_http1.c
switch (client->method) {
case HTTP_HEAD:
if (user_method & BIT(HTTP_HEAD)) {
ret = SEND_RESPONSE(RESPONSE_TEMPLATE_DYNAMIC,
dynamic_detail->common.content_type);
if (ret < 0) {
return ret;
}
dynamic_detail->holder = NULL;
return 0;
}
case HTTP_GET:
/* For GET request, we do not pass any data to the app but let the app
* send data to the peer.
*/
if (user_method & BIT(HTTP_GET)) {
return dynamic_get_req(dynamic_detail, client);
}
goto not_supported;
case HTTP_POST:
if (user_method & BIT(HTTP_POST)) {
return dynamic_post_req(dynamic_detail, client);
}
goto not_supported;
not_supported:
default:
LOG_DBG("HTTP method %s (%d) not supported.",
http_method_str(client->method),
client->method);
return -ENOTSUP;
}
And http_server_http2.c
switch (client->method) {
case HTTP_GET:
if (user_method & BIT(HTTP_GET)) {
return dynamic_get_req_v2(dynamic_detail, client);
}
goto not_supported;
case HTTP_POST:
/* The data will come in DATA frames. Remember the detail ptr
* which needs to be known when passing data to application.
*/
if (user_method & BIT(HTTP_POST)) {
client->current_detail =
(struct http_resource_detail *)dynamic_detail;
break;
}
goto not_supported;
not_supported:
default:
LOG_DBG("HTTP method %s (%d) not supported.",
http_method_str(client->method),
client->method);
return -ENOTSUP;
}
Describe the solution you'd like
The HTTP server should support additional methods, at least PUT and DELETE to allow proper API implementations.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The HTTP Server currently only supports
GET
andPOST
methods as seen inhttp_server_http1.c
And
http_server_http2.c
Describe the solution you'd like
The HTTP server should support additional methods, at least
PUT
andDELETE
to allow proper API implementations.The text was updated successfully, but these errors were encountered: