Skip to content

Commit

Permalink
fix: proper optional types for Request
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexcited committed Aug 5, 2024
1 parent ba83444 commit 2e42ff3
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,25 @@ export const getHeaderFromResponse = (response: Response, item: string): string

export interface Request {
url: string
method: string
/** Body of the request of type given in the "Content-Type" header. */
content: string | undefined

/**
* @default "GET"
*/
method?: string

/**
* Body of the request.
* @default undefined
*/
content?: string

/** Headers that should be appended to the request. */
headers: Record<string, string> | Headers
redirect: "follow" | "manual"
headers?: Record<string, string> | Headers

/**
* @default "follow"
*/
redirect?: "follow" | "manual"
}

export interface Response {
Expand Down

0 comments on commit 2e42ff3

Please sign in to comment.