private HttpRequestMessage BuildHttpPostRequestMessage(string targetUrl, IOfficialRequest officialRequest) { return(new HttpRequestMessage(HttpMethod.Post, targetUrl) { Content = new StringContent(officialRequest.ToString()) }); }
private HttpRequestMessage BuildHttpPostRequestMessage(string targetUrl, IOfficialRequest officialRequest, HttpContent httpContent = null) { if (httpContent is object) { var request = BuildHttpGetRequestMessage(targetUrl, officialRequest); request.Content = httpContent; return(request); } else { return(new HttpRequestMessage(HttpMethod.Post, targetUrl) { Content = new StringContent(officialRequest.ToString()) }); } }