Skip to content

Instantly share code, notes, and snippets.

@dafinoer
Created March 9, 2021 09:00
Show Gist options
  • Save dafinoer/b597ad9e1671246df7ee81870daf3cc7 to your computer and use it in GitHub Desktop.
Save dafinoer/b597ad9e1671246df7ee81870daf3cc7 to your computer and use it in GitHub Desktop.
void _setupChopper() {
final httpx = HttpClient();
httpx.findProxy = (url) => 'PROXY <ip_address_from_postman>:9090';
httpx.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
_client = ChopperClient(
converter: JsonConverter(),
baseUrl: baseurl,
client: http.IOClient(httpx),
interceptors: [HttpLoggingInterceptor(), _requestIntercept],
services: [
SessionServices.create(),
AuthServices.create(),
UserServices.create(),
PayrollServices.create()
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment