[英]ON c# I'm use Restsharp read data json client.Execute(request); why show format XML how do show format JSON
[英]Get Response Data in XML format in IRestResponse response = client.Execute(request);
我正在使用restsharp客戶端來執行restful API。 我想在執行restful API時以XML格式獲取響應數據。
IRestResponse response = client.Execute(request);
API返回'XML'格式。 非常感謝您提供的任何幫助。
我找到了解決方案。 需要在請求中添加header參數。 請參閱以下代碼。
request.AddHeader("Accept", "text/xml");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.