How to configure the http version in Ballerina http client?

45 Views Asked by At

Is there a way to configure the HTTP version in client? What is the default HTTP version used in Ballerina HTTP Client?

1

There are 1 best solutions below

0
On

The HTTP version can be configured via HTTP client config using the httpVersion field. If this configuration is not provided, HTTP version 2 is taken as the default version.

import ballerina/http;

http:Client httpClient = check new ("https://api.asg.io/t/aorg/oauth2", config = { httpVersion: http:HTTP_1_1 });