How to send XML content with HttpClient.PostAsync?

后端 未结 2 902
忘掉有多难
忘掉有多难 2021-02-04 23:43

I am trying to fulfill this rest api:

public async Task AddTimetracking(Issue issue, int spentTime)
{
    // POST /rest/issue/{issue}/timetracking/wo         


        
2条回答
  •  悲哀的现实
    2021-02-05 00:24

    You could use

    var respone = await httpClient.PostAsXmlAsync(requestUri, workItem);
    

    https://msdn.microsoft.com/en-us/library/system.net.http.httpclientextensions_methods

提交回复
热议问题