mirror of
https://codeberg.org/reflect/reflect-client-js.git
synced 2025-09-14 10:33:40 +02:00
fix: no request body on GET requests (#5)
This commit is contained in:
parent
2be18c2a33
commit
a9317671b1
2 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "reflect-client",
|
"name": "reflect-client",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"main": "build/Reflect.js",
|
"main": "build/Reflect.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
@ -38,8 +38,8 @@ export default class Client {
|
||||||
headers: this.headers
|
headers: this.headers
|
||||||
}
|
}
|
||||||
|
|
||||||
// JSON stringify and append body to request if provided
|
// JSON stringify and append body to request if provided and is not a GET request
|
||||||
if (payload) {
|
if (payload && method !== Method.GET) {
|
||||||
options["body"] = JSON.stringify(payload);
|
options["body"] = JSON.stringify(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue