Skip to content

Commit

Permalink
Allow getHeader methods to return undefined (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut authored Aug 23, 2024
1 parent 2387d07 commit 893580c
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 893580c

Please sign in to comment.