Witam,
Mam problem. Kod wygląda następująco.
var nvc = new List<KeyValuePair<string, string>>();
//nvc.Add(new KeyValuePair<string, string>("Input1", "TEST2"));
var url = "http://rapidu.net/api/getFileDetails/";
nvc.Add(new KeyValuePair<string, string>("id", "0932962782"));
var client = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, url) { Content = new FormUrlEncodedContent(nvc) };
var res = await client.SendAsync(req);
string totxtbox; // DO TEGO CHCIAŁBYM PRZYPISAC WYNIK ZWRÓCONEGO ZAPYTANIA POPRZEZ API ABY POTEM ZWROCIC GO DO TEXTBOXA
Robiłem też testy na konću za pomocą dopisania na końcu powyższego kodu kod na następujący:
totxtbox = res.RequestMessage.RequestUri.ToString();
textBox1.Text = totxtbox;
Jednak zamiast zwrócić dane w formacie jsona zwraca mi samego stringa do requesta:
http://rapidu.net/api/getFileDetails/
Chciałbym aby zwróciło mi coś takiego:
{"0":{"fileStatus":1,"fileId":"0932962782","fileName":"DxO.PhotoLab.Elite.v.2.1.1.23555.rar","fileDesc":"","fileSize":"381749664","fileUrl":"https:\/\/rapidu.net\/0932962782\/DxO.PhotoLab.Elite.v.2.1.1.23555.rar"}}
EDYCJA://
Problem rozwiązałem temat do zamkniecia. :)