Ladybird: Teach RequestManagerQt how to handle every valid HTTP method
This commit is contained in:
parent
2ed5415750
commit
c51026a855
Notes:
sideshowbarker
2024-07-17 02:35:27 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/c51026a855 Pull-request: https://github.com/SerenityOS/serenity/pull/17383 Reviewed-by: https://github.com/linusg
1 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,12 @@ ErrorOr<NonnullRefPtr<RequestManagerQt::Request>> RequestManagerQt::Request::cre
|
|||
reply = qnam.get(request);
|
||||
} else if (method.equals_ignoring_case("post"sv)) {
|
||||
reply = qnam.post(request, QByteArray((char const*)request_body.data(), request_body.size()));
|
||||
} else if (method.equals_ignoring_case("put"sv)) {
|
||||
reply = qnam.put(request, QByteArray((char const*)request_body.data(), request_body.size()));
|
||||
} else if (method.equals_ignoring_case("delete"sv)) {
|
||||
reply = qnam.deleteResource(request);
|
||||
} else {
|
||||
reply = qnam.sendCustomRequest(request, QByteArray(method.characters()), QByteArray((char const*)request_body.data(), request_body.size()));
|
||||
}
|
||||
|
||||
return adopt_ref(*new Request(*reply));
|
||||
|
|
Loading…
Add table
Reference in a new issue