postAsync method

Future<File?> postAsync(
  1. MultipartBody body, [
  2. void requestConfiguration(
    1. RequestConfiguration<DefaultQueryParameters>
    )?
])

To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.

All of Stripe’s officially supported Client libraries support sending multipart/form-data.

[body] The request body [requestConfiguration] Configuration for the request such as headers, query parameters, and middleware options.

Implementation

Future<File?> postAsync(MultipartBody body,
    [void Function(RequestConfiguration<DefaultQueryParameters>)?
        requestConfiguration]) async {
  var requestInfo = toPostRequestInformation(body, requestConfiguration);
  final errorMapping = <String, ParsableFactory<Parsable>>{
    'XXX': Error.createFromDiscriminatorValue,
  };
  return await requestAdapter.send<File>(
      requestInfo, File.createFromDiscriminatorValue, errorMapping);
}