fix: no request body on GET requests (#5)

This commit is contained in:
Victor Westerlund 2023-11-09 11:54:31 +01:00 committed by GitHub
parent 2be18c2a33
commit a9317671b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "reflect-client",
"version": "1.1.0",
"version": "1.1.1",
"main": "build/Reflect.js",
"type": "module",
"exports": {

View file

@ -38,8 +38,8 @@ export default class Client {
headers: this.headers
}
// JSON stringify and append body to request if provided
if (payload) {
// JSON stringify and append body to request if provided and is not a GET request
if (payload && method !== Method.GET) {
options["body"] = JSON.stringify(payload);
}