Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow getHeader methods to return undefined #710

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading