post method

Future<Map<String, dynamic>> post(
  1. String endpoint, {
  2. dynamic body,
  3. bool requiresAuth = true,
  4. Map<String, String>? headers,
})

Makes a POST request to the specified endpoint with the given body.

If requiresAuth is true, authentication will be included in the request. Additional headers can be provided. If a response is received, the body is parsed as JSON and returned.

Implementation

Future<Map<String, dynamic>> post(
  String endpoint, {
  dynamic body,
  bool requiresAuth = true,
  Map<String, String>? headers,
}) async {
  return _makeRequest(
    method: 'POST',
    endpoint: endpoint,
    body: body,
    requiresAuth: requiresAuth,
    headers: headers,
  );
}