You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I want to access a method present only in HttpClient, then another one in RhttpClient and then wants to provide an http.Client from the crate http to a method/function.
I thought I could do like this:
// create an httpClient compatible clientfinal innerClient =awaitIoCompatibleClient.create();
// use a method only available in httpClient// there is no callback equivalent in RhttpCompatibleClient to get the cert of a response.
innerClient.badCertificateCallback = (X509Certificate cert, String url, int port) {
// do something with the cert then return boolreturnfalse;
};
// convert client to http.Clientfinal client =IOClient(innerclient);
// transfer it in a function that takes a http.Client and call client.post(url:..., headers:..., body:...)MethodUsingPackageHttp(client);
client.post(url).
The exception is: Error: [RhttpUnknownException] hyper_util::client::legacy::Error(SendRequest, hyper::Error(IncompleteMessage))
Indeed, when analyzing the request sent this way, there is no header nor body even if attached to the IOClient(innerclient).
The text was updated successfully, but these errors were encountered:
IOCompatibleClient implements dart:io:HttpClient.
I have a use case where I want to access a method present only in HttpClient, then another one in RhttpClient and then wants to provide an http.Client from the crate http to a method/function.
I thought I could do like this:
The exception is:
Error: [RhttpUnknownException] hyper_util::client::legacy::Error(SendRequest, hyper::Error(IncompleteMessage))
Indeed, when analyzing the request sent this way, there is no header nor body even if attached to the IOClient(innerclient).
The text was updated successfully, but these errors were encountered: