Return value of UploadStringAsync().?

后端 未结 3 796
臣服心动
臣服心动 2021-01-21 21:01

My question is correct or incorrect I don\'t know, but I would like to know if is it possible to return the value of UploadStringAsync() of post methods using WebClient?

<
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 21:34

    From .NET 4.5 we can use UploadStringTaskAsync to retrieve return value directly.

    string rspBody = await client.UploadStringTaskAsync(uri, "POST");
    

    ref: MSDN

提交回复
热议问题