public async Task <OcrResult <OcrAccountInfoResponse> > AccountInfo() { string url = _url + _accountInfoMethod; // problem : impossible to set ContentType (mediaType) with GET method // Cannot send a content-body with this verb-type. (System.Net.ProtocolViolationException) // Content = new TextContent("", mediaType: _contentType) HttpResult_v5 <string> httpResult = await _httpManager.LoadText(new HttpRequest_v5 { Url = url }); OcrResult <OcrAccountInfoResponse> result = new OcrResult <OcrAccountInfoResponse> { Success = httpResult.Success, StatusCode = httpResult.StatusCode }; if (httpResult.Success) { result.Data = BsonSerializer.Deserialize <OcrAccountInfoResponse>(httpResult.Data); } return(result); }
private static async Task LoadText(HttpManager_v5 httpManager, HttpRequest_v5 request) { httpManager.ActiveCookies(); httpManager.SetDefaultHeaders(); HttpResult_v5 <string> httpResult = await httpManager.LoadText(request); Trace.WriteLine($"success {httpResult.Success} loadFromWeb {httpResult.LoadFromWeb} loadFromCache {httpResult.LoadFromCache}"); Trace.WriteLine(); TraceCookies(httpManager, request.Url); }