i have problems with my c# programm to send or receive cURL requests to a online telephone system, i hope to get some help there :)
I want to send commands like this:>
I prefer using WebClient
WebClient wc = new WebClient();
var buf = wc.UploadValues("https://api.placetel.de/api/test",
new NameValueCollection() { { "api_key", "XXXX" } });
var xml = Encoding.UTF8.GetString(buf);
or HttpClient
HttpClient client = new HttpClient();
var content = new FormUrlEncodedContent(new Dictionary() {
{ "api_key", "XXXX" }
});
var resp = await client.PostAsync("https://api.placetel.de/api/test",content);
var xml = await resp.Content.ReadAsStringAsync();
which have methods easier to use.
BTW, -d (or --data)
is a parameter of curl, it is not sent to server
PS: You may also want to read something about ContentType
http://www.freeformatter.com/mime-types-list.html