Movatterモバイル変換


[0]ホーム

URL:


Index (R) »AWS »Response
Weannounced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate toAWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.Response

Inherits:
Object
  • Object
  • AWS.Response
show all
Defined in:
lib/response.js

Overview

This class encapsulates the response informationfrom a service request operation sent throughAWS.Request.The response object has two main properties for getting informationback from a request:

Thedata property

Theresponse.data property contains the serialized object dataretrieved from the service request. For instance, for anAmazon DynamoDBlistTables method call, the response data mightlook like:

> resp.data{ TableNames:   [ 'table1', 'table2', ... ] }

Thedata property can be null if an error occurs (see below).

Theerror property

In the event of a service error (or transfer error), theresponse.error property will be filled with the givenerror data in the form:

{ code: 'SHORT_UNIQUE_ERROR_CODE',  message: 'Some human readable error message' }

In the case of an error, thedata property will benull.Note that if you handle events that can be in a failure state,you should always check whetherresponse.error is setbefore attempting to access theresponse.data property.

See Also:

Data Propertiescollapse

Operation Propertiescollapse

HTTP Propertiescollapse

HTTP Propertiescollapse

Property Details

dataObject(readonly)

Note:

Inside of aAWS.Request~httpData event, thisproperty contains a single raw packet instead of thefull de-serialized service response.

Returns the de-serialized response datafrom the service.

Returns:

  • (Object)

    the de-serialized response datafrom the service.

errorError(readonly)

Note:

This attribute is only filled if a service ornetworking error occurs.

An structure containing information about a serviceor networking error.

Returns:

  • (Error)
    • code [String] a unique short code representing theerror that was emitted.
    • message [String] a longer human readable error message
    • retryable [Boolean] whether the error message isretryable.
    • statusCode [Numeric] in the case of a request that reached the service,this value contains the response status code.
    • time [Date] the date time object when the error occurred.
    • hostname [String] set when a networking error occurs to easilyidentify the endpoint of the request.
    • region [String] set when a networking error occurs to easilyidentify the region of the request.

httpResponseAWS.HttpResponse(readonly)

Returns the raw HTTP response objectcontaining the response headers and body informationfrom the server.

Returns:

  • (AWS.HttpResponse)

    the raw HTTP response objectcontaining the response headers and body informationfrom the server.

redirectCountInteger(readonly)

Returns the number of redirects that werefollowed before the request was completed.

Returns:

  • (Integer)

    the number of redirects that werefollowed before the request was completed.

requestIdString(readonly)

Returns the unique request ID associated with the response.Log this value when debugging requests for AWS support.

Returns:

  • (String)

    the unique request ID associated with the response.Log this value when debugging requests for AWS support.

retryCountInteger(readonly)

Returns the number of retries that wereattempted before the request was completed.

Returns:

  • (Integer)

    the number of retries that wereattempted before the request was completed.

Method Details

hasNextPage() ⇒Boolean

Returns whether more pages of data can be returned by furtherrequests.

Returns:

  • (Boolean)

    whether more pages of data can be returned by furtherrequests

Since:

  • v1.4.0

nextPage(callback) ⇒AWS.Request?

Creates a new request for the next page of response data, calling thecallback with the page data if a callback is provided.

Callback (callback):

  • function(err, data) { ... }

    Called when a page of data is returned from the next request.

    Parameters:

    • err(Error)

      an error object, if an error occurred in the request

    • data(Object)

      the next page of data, or null, if there are nomore pages left.

Returns:

  • (AWS.Request)

    the request object for the next page of data

  • (null)

    if no callback is provided and there are no pages leftto retrieve.

Since:

  • v1.4.0

Generated on Wed Nov 6 18:52:05 2024 byyard 0.9.36 (ruby-2.5.1).

[8]ページ先頭

©2009-2025 Movatter.jp