Skip to content

Commit

Permalink
data no longer able to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymholt committed Oct 23, 2023
1 parent ebeb5cf commit 69127e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ export type IHttpRequestOptions = Pick<Partial<IHttpRawRequestOptions>, "headers
saveResponseToFile?: string;
};
export interface IHttpResponse<T> {
data?: T;
body?: string | null;
data: T;
body: string | null;
headers: IncomingHttpHeaders;
statusCode: number | undefined;
statusMessage: string | undefined;
Expand Down Expand Up @@ -710,6 +710,7 @@ _http.post = async <T>(url: string, data: HttpData, headers: { [name: string]: s
const response = await _http<T>("POST", url, data, { headers });
return response.data;
};

/**
* Makes a PUT HTTP request and returns the response data. Will throw an error if the response status code is not 2xx.
* @param url
Expand Down

0 comments on commit 69127e3

Please sign in to comment.