We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c453025 commit 33bae0eCopy full SHA for 33bae0e
src/index.ts
@@ -17,13 +17,17 @@ export class TempMail {
17
private async makeRequest(url: string, post_data?: any, method?: "POST" | "GET" | "DELETE"): Promise<any> {
18
19
let headers = {
20
- "User-Agent": "TempMailJS/4.1.0"
+ "User-Agent": "TempMailJS/4.3.0"
21
};
22
23
//if the user is a TempMail Plus subscriber, add the credentials here
24
if(this.api_key) {
25
headers["Authorization"] = "Bearer " + this.api_key;
26
}
27
+
28
+ if(method && method === "POST" && post_data) {
29
+ headers["Content-Type"] = "application/json";
30
+ }
31
32
const raw = await fetch(BASE_URL + url, {
33
headers,
0 commit comments