0 purchases
curl generator
curl_generator #
A Dart package to create simple curl (bash) with params, headers and body.
Getting started #
To use this plugin, add curl_generator as a dependency in your pubspec.yaml file.
Usage #
Example
const url =
'http://some.api.com/some/api?some=some¶ms=params';
// or
const url =
'http://some.api.com/some/api';
const params = {
'some': 'some',
'params': 'params',
};
const header = {
'Accept': 'application/json',
'Accept-Language': 'en-US,en;q=0.9',
'Connection': 'keep-alive',
};
const body = {
'some': 'some',
'value': 'value',
'intValue': 123,
};
final result = Curl.curlOf(
url: url,
header: header, // optional
queryParams: params, // optional
body: body, // optional
);
// output will be
// curl 'http://some.api.com/some/api?some=some¶ms=params' \
// -H 'Accept: application/json' \
// -H 'Accept-Language: en-US,en;q=0.9' \
// -H 'Connection: keep-alive' \
// --data-raw '{"some":"some","value":"value","intValue":123}' \
// --compressed \
// --insecure
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.