private async Task <HttpWebResponse> ExecuteMethodAsync <TReq>( string method, string endpoint, TReq request, string alternativeEndpointBase = null) where TReq : class { // TODO make the buffer size configurable using (var input = new MemoryStream()) { if (request != null) { Serializer.Serialize(input, request); } return(await _requester.IssueWebRequestAsync(endpoint, method : method, input : input, alternativeEndpointBase : alternativeEndpointBase)); } }
private async Task <Response> ExecuteMethodAsync <TReq>( string method, string query, string endpoint, TReq request, RequestOptions options) where TReq : class { using (var input = new MemoryStream(options.SerializationBufferSize)) { if (request != null) { Serializer.Serialize(input, request); } input.Seek(0, SeekOrigin.Begin); return(await _requester.IssueWebRequestAsync(endpoint, query, method, input, options)); } }
private async Task <Response> ExecuteMethodAsync( string method, byte[] request, RequestOptions options) { using (var input = new MemoryStream(request)) { return(await _requester.IssueWebRequestAsync(method : method, input : input, options : options)); } }
private Task <Response> ExecuteMethodAsync <TReq>(HttpMethod method, string query, string endpoint, TReq request) where TReq : IMessage <TReq> { endpoint.ArgumentNotNull(nameof(endpoint)); return(_requester.IssueWebRequestAsync(endpoint, query, method, request?.ToByteArray())); }