Skip to content

Commit

Permalink
adding union type for http methods to gradually change to the enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Boudreau committed Feb 23, 2018
1 parent 079e454 commit 7d7400c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export enum HTTPMethod {
OPTIONS = "OPTIONS",
}

export type methods = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";

export class Request {
private readonly transport = Popsicle.createTransport({
rejectUnauthorized: false, // Need to tell node to ignore bad ssl cert
type: "text",
});
public send(method: HTTPMethod, url: string, body?: string): Promise<string> {
public send(method: HTTPMethod | methods, url: string, body?: string): Promise<string> {
const opts = {
body,
headers: {
Expand Down

0 comments on commit 7d7400c

Please sign in to comment.