Skip to content

Commit ccbb5d4

Browse files
committed
Set body null for GET/DELETE
1 parent 794f76f commit ccbb5d4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/HTTP.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,43 +56,43 @@ library HTTP {
5656
}
5757

5858
function GET(HTTP.Request storage req) internal returns (HTTP.Request storage) {
59-
return withMethod(req, HTTP.Method.GET);
59+
return withBody(withMethod(req, HTTP.Method.GET), "");
6060
}
6161

6262
function GET(HTTP.Request storage req, string memory url) internal returns (HTTP.Request storage) {
63-
return withUrl(withMethod(req, HTTP.Method.GET), url);
63+
return GET(withUrl(req, url));
6464
}
6565

6666
function POST(HTTP.Request storage req) internal returns (HTTP.Request storage) {
6767
return withMethod(req, HTTP.Method.POST);
6868
}
6969

7070
function POST(HTTP.Request storage req, string memory url) internal returns (HTTP.Request storage) {
71-
return withUrl(withMethod(req, HTTP.Method.POST), url);
71+
return POST(withUrl(req, url));
7272
}
7373

7474
function PUT(HTTP.Request storage req) internal returns (HTTP.Request storage) {
7575
return withMethod(req, HTTP.Method.PUT);
7676
}
7777

7878
function PUT(HTTP.Request storage req, string memory url) internal returns (HTTP.Request storage) {
79-
return withUrl(withMethod(req, HTTP.Method.PUT), url);
79+
return PUT(withUrl(req, url));
8080
}
8181

8282
function DELETE(HTTP.Request storage req) internal returns (HTTP.Request storage) {
83-
return withMethod(req, HTTP.Method.DELETE);
83+
return withBody(withMethod(req, HTTP.Method.DELETE), "");
8484
}
8585

8686
function DELETE(HTTP.Request storage req, string memory url) internal returns (HTTP.Request storage) {
87-
return withUrl(withMethod(req, HTTP.Method.DELETE), url);
87+
return DELETE(withUrl(req, url));
8888
}
8989

9090
function PATCH(HTTP.Request storage req) internal returns (HTTP.Request storage) {
9191
return withMethod(req, HTTP.Method.PATCH);
9292
}
9393

9494
function PATCH(HTTP.Request storage req, string memory url) internal returns (HTTP.Request storage) {
95-
return withUrl(withMethod(req, HTTP.Method.PATCH), url);
95+
return PATCH(withUrl(req, url));
9696
}
9797

9898
function withBody(HTTP.Request storage req, string memory body) internal returns (HTTP.Request storage) {

0 commit comments

Comments
 (0)