postAuthorized function

Future<Response> postAuthorized(
  1. String endpoint, {
  2. String? body,
  3. Client? client,
  4. required Credential credential,
  5. bool isSandbox = false,
})

Makes an authorized POST request to the Coinbase Advanced Trade API.

This function generates a JWT, and then makes a POST request to the specified endpoint with the JWT in the Authorization header.

endpoint - The API endpoint to make the request to. body - The body of the request. client - Optional http.Client to use for the request. credential - The user's API credentials. isSandbox - Whether to use the sandbox environment.

Returns an http.Response object.

Implementation

Future<http.Response> postAuthorized(String endpoint,
    {String? body,
    http.Client? client,
    required Credential credential,
    bool isSandbox = false}) async {
  return await _makeAuthorizedRequest(
      method: _HttpMethod.post,
      endpoint: endpoint,
      body: body,
      client: client,
      credential: credential,
      isSandbox: isSandbox);
}