簡體   English   中英

為Curl命令創建等效的RestSharp

[英]create RestSharp equivalent for Curl command

這是卷發。

curl -H "Content-Type: application/json" -vX POST -d "[\"Channel1.Device1.tag1\"]" host_name/read

我需要將其轉換為restSharp代碼,

此刻,我正在做,

var client = new RestClient("host_name/read");

var request = new RestRequest( Method.POST);

IRestResponse response = client.Execute(request);
var content = response.Content; // raw content as string

我不知道如何解決這個-d參數。

我終於能夠解決這個問題。 請參閱下面的鏈接以獲取其魅力所在的答案。

http://www.hackered.co.uk/articles/sending-json-strings-with-restsharp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM