var client = new HttpClient();
string followCode = "843914957251";
int companyId = 1;
string apiKey = "API-KEY-BURAYA";
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://kargom-nerede.p.rapidapi.com/tracking"),
Headers =
{
{ "X-RapidAPI-Key", apiKey },
{ "X-RapidAPI-Host", "kargom-nerede.p.rapidapi.com" },
},
Content = new StringContent("{\r\n \"code\": \""+followCode+"\",\r\n \"companyId\": "+companyId+"\r\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
return body;//Yanıtı string olarak döndürür.
}