class

Binance::Responses::ServerResponse

Inherits JSON::Serializable < Reference < Object

The ServerResponse class is the base class returned for all endpoint calls

  • If the endpoint call was successfully executed and parsed, then the success property will be true. Otherwise it will be false and error property will contain the error message.
  • If the endpoint itself is returning an error, the error_code will also be populated.
  • If an exception occurred (for example timeout error), then it's message is captured to the error property and the exception itself is captured to the exception property. In all cases, the raw response from the endpoint is captured to the response property.

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

consume_body(response)
Source

Instance methods

body

The unparsed body of the HTTP response

Source
consume_body(response)
Source
error_code

The error code returned by the API endpoint (if any).

Source
error_code=(error_code : Int32 | Nil)

The error code returned by the API endpoint (if any).

Source
error_message

The error message from either the API endpoint or Exception captured (if any).

Source
error_message=(error_message : String | Nil)

The error message from either the API endpoint or Exception captured (if any).

Source
exception

The exception captured (if any).

Source
exception=(exception : Exception | Nil)

The exception captured (if any).

Source
response

The full HTTP Response object captured (if any).

Source
response=(response : HTTP::Client::Response | Nil)

The full HTTP Response object captured (if any).

Source
success

TRUE if API endpoint successfully processed, FALSE otherwise

Source
success=(success : Bool)

TRUE if API endpoint successfully processed, FALSE otherwise

Source
used_weight
Source