Merge pull request #185 from LemmyNet/add_set_header_func

Add set header func
This commit is contained in:
SleeplessOne1917 2023-09-18 19:45:03 -04:00 committed by GitHub
commit e2c87b2dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"version": "0.19.0-rc.7", "version": "0.19.0-rc.9",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"repository": "https://github.com/LemmyNet/lemmy-js-client", "repository": "https://github.com/LemmyNet/lemmy-js-client",
"license": "AGPL-3.0", "license": "AGPL-3.0",

View file

@ -1359,6 +1359,13 @@ export class LemmyHttp {
return json; return json;
} }
} }
/**
* Set the headers (can be used to set the auth header)
*/
setHeaders(headers: { [key: string]: string }) {
this.#headers = headers;
}
} }
function encodeGetParams<BodyType extends object>(p: BodyType): string { function encodeGetParams<BodyType extends object>(p: BodyType): string {