Skip to content

Commit

Permalink
Allow getHeader methods to return undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Aug 23, 2024
1 parent 2387d07 commit 1bdbefa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ interface HttpRequest {
getURL(): string;

setHeader(header: string, value: string);
getHeader(header: string);
getHeader(header: string): string | undefined;

setProgressHandler((bytesSent: number): void): void;
// Send the HTTP request with the provided request body. The value of the request body depends
Expand All @@ -339,7 +339,7 @@ interface HttpRequest {

interface HttpResponse {
getStatus(): number;
getHeader(header: string): string;
getHeader(header: string): string | undefined;
getBody(): string;

// Return an environment specific object, e.g. the XMLHttpRequest object in browsers.
Expand Down
4 changes: 2 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface HttpRequest {
getURL(): string

setHeader(header: string, value: string): void
getHeader(header: string): string
getHeader(header: string): string | undefined

setProgressHandler(handler: (bytesSent: number) => void): void
send(body: any): Promise<HttpResponse>
Expand All @@ -118,7 +118,7 @@ export interface HttpRequest {

export interface HttpResponse {
getStatus(): number
getHeader(header: string): string
getHeader(header: string): string | undefined
getBody(): string

// Return an environment specific object, e.g. the XMLHttpRequest object in browsers.
Expand Down

0 comments on commit 1bdbefa

Please sign in to comment.