private HttpRequestMessage BuildHttpPostRequestMessage(string targetUrl, IOfficialRequest officialRequest)
 {
     return(new HttpRequestMessage(HttpMethod.Post, targetUrl)
     {
         Content = new StringContent(officialRequest.ToString())
     });
 }
Пример #2
0
 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())
         });
     }
 }