Compare commits

..

No commits in common. "master" and "1.1.1" have entirely different histories.

2 changed files with 2 additions and 8 deletions

View file

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

View file

@ -18,14 +18,9 @@ export default class Client {
} }
} }
// Set request header
private setHeader(name, value): void {
return this.headers[name] = value;
}
// Set API key to use for all requests // Set API key to use for all requests
private setApiKey(key: string): void { private setApiKey(key: string): void {
return this.setHeader("Authorization", `Bearer ${key}`); this.headers["Authorization"] = `Bearer ${key}`;
} }
// Get fully qualified URL to endpoint // Get fully qualified URL to endpoint
@ -45,7 +40,6 @@ export default class Client {
// JSON stringify and append body to request if provided and is not a GET request // JSON stringify and append body to request if provided and is not a GET request
if (payload && method !== Method.GET) { if (payload && method !== Method.GET) {
this.setHeader("Content-Type", "application/json");
options["body"] = JSON.stringify(payload); options["body"] = JSON.stringify(payload);
} }