How to use the @aws-sdk/protocol-http.HttpResponse function in @aws-sdk/protocol-http

To help you get started, we’ve selected a few @aws-sdk/protocol-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-sdk-js-v3 / packages / response-metadata-extractor / src / index.spec.ts View on Github external
it("should prefer the request ID from the standard header", () => {
    expect(
      extractMetadata(new HttpResponse({
        ...httpResponseOptions,
        headers: {
          "X-Amz-Request-ID": "id",
          "X-Amz-RequestId": "alt_id"
        }
      })).requestId
    ).toBe("id");
  });
github aws / aws-sdk-js-v3 / packages / response-metadata-extractor / src / index.spec.ts View on Github external
it("should extract and downcase headers", () => {
    const response = new HttpResponse(httpResponseOptions);
    expect(extractMetadata(response).httpHeaders).toEqual({
      foo: response.headers.Foo,
      fizz: response.headers.Fizz,
      snap: response.headers.Snap
    });
  });
github aws / aws-sdk-js-v3 / packages / response-metadata-extractor / src / index.spec.ts View on Github external
it("should extract the status code from responses", () => {
    const response = new HttpResponse(httpResponseOptions);
    expect(extractMetadata(response).httpStatusCode).toBe(response.statusCode);
  });
github aws / aws-sdk-js-v3 / packages / node-http-handler / src / node-http2-handler.ts View on Github external
req.on("response", headers => {
        const httpResponse = new HttpResponse({
          statusCode: headers[":status"] || -1,
          headers: getTransformedHeaders(headers),
          body: req
        });
        resolve({ response: httpResponse });
      });
github aws / aws-sdk-js-v3 / packages / node-http-handler / src / node-http-handler.ts View on Github external
const req = (isSSL ? https : http).request(nodeHttpsOptions, res => {
        const httpResponse = new HttpResponse({
          statusCode: res.statusCode || -1,
          headers: getTransformedHeaders(res.headers),
          body: res
        });
        resolve({ response: httpResponse });
      });

@aws-sdk/protocol-http

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/protocol-http/latest.svg)](https://www.npmjs.com/package/@aws-sdk/protocol-http) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/protocol-http.svg)](https://www.npmjs.com/package/@aws-sdk/prot

Apache-2.0
Latest version published 1 year ago

Package Health Score

72 / 100
Full package analysis

Similar packages