@aws-sdk/protocol-http
- Version 3.342.0
- Published
- 28.5 kB
- 2 dependencies
- Apache-2.0 license
Install
npm i @aws-sdk/protocol-http
yarn add @aws-sdk/protocol-http
pnpm add @aws-sdk/protocol-http
Overview
[](https://www.npmjs.com/package/@aws-sdk/protocol-http) [](https://www.npmjs.com/package/@aws-sdk/prot
Index
Functions
Classes
Interfaces
Enums
Type Aliases
Functions
function isValidHostname
isValidHostname: (hostname: string) => boolean;
Classes
class Field
class Field {}
A name-value pair representing a single field transmitted in an HTTP Request or Response.
The kind will dictate metadata placement within an HTTP message.
All field names are case insensitive and case-variance must be treated as equivalent. Names MAY be normalized but SHOULD be preserved for accuracy during transmission.
constructor
constructor({ name, kind, values }: FieldOptions);
property kind
readonly kind: FieldPosition;
property name
readonly name: string;
property values
values: string[];
method add
add: (value: string) => void;
Appends a value to the field.
Parameter value
The value to append.
method get
get: () => string[];
Get string values as a list
Returns
Values in Field as a list.
method remove
remove: (value: string) => void;
Remove all matching entries from list.
Parameter value
Value to remove.
method set
set: (values: string[]) => void;
Overwrite existing field values.
Parameter values
The new field values.
method toString
toString: () => string;
Get comma-delimited string.
Returns
String representation of Field.
class Fields
class Fields {}
Collection of Field entries mapped by name.
constructor
constructor({ fields, encoding }: FieldsOptions);
method getByType
getByType: (kind: FieldPosition) => Field[];
Helper function for retrieving specific types of fields. Used to grab all headers or all trailers.
Parameter kind
FieldPosition of entries to retrieve.
Returns
The Field entries with the specified FieldPosition.
method getField
getField: (name: string) => Field | undefined;
method removeField
removeField: (name: string) => void;
Delete entry from collection.
Parameter name
Name of the entry to delete.
method setField
setField: (field: Field) => void;
class HttpRequest
class HttpRequest implements HttpMessage, Endpoint {}
constructor
constructor(options: any);
property body
body?: any;
property headers
headers: HeaderBag;
property hostname
hostname: string;
property method
method: string;
property path
path: string;
property port
port?: number;
property protocol
protocol: string;
property query
query: QueryParameterBag;
method clone
clone: () => HttpRequest;
method isInstance
static isInstance: (request: unknown) => request is HttpRequest;
class HttpResponse
class HttpResponse {}
constructor
constructor(options: any);
property body
body?: any;
property headers
headers: HeaderBag;
property statusCode
statusCode: number;
method isInstance
static isInstance: (response: unknown) => response is HttpResponse;
Interfaces
interface HttpRequest
interface HttpRequest extends IHttpRequest {}
interface HttpResponse
interface HttpResponse extends IHttpResponse {}
Enums
enum FieldPosition
enum FieldPosition { HEADER = 0, TRAILER = 1,}
Type Aliases
type FieldOptions
type FieldOptions = { name: string; kind?: FieldPosition; values?: string[];};
type FieldsOptions
type FieldsOptions = { fields?: Field[]; encoding?: string;};
type HttpHandler
type HttpHandler = RequestHandler<HttpRequest, HttpResponse, HttpHandlerOptions>;
Package Files (8)
Dependencies (2)
Dev Dependencies (6)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-sdk/protocol-http
.
- Markdown[](https://www.jsdocs.io/package/@aws-sdk/protocol-http)
- HTML<a href="https://www.jsdocs.io/package/@aws-sdk/protocol-http"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3020 ms. - Missing or incorrect documentation? Open an issue for this package.