I am using one asp.net application where i am calling web api using HttpClient.
in web API controller i am passing two parameter one is int and second is string.
Below is the code:
public HttpResponseMessage Get(int submissionID, string jsonData)
{
}
This is working fine no issues when i am passing one int and one string parameter using httpClient
Below is my httpClient code:
public void GetWebApiData(int fileID, String jsonData)
{
var client = new HttpClient();
var task = client.GetAsync("http://localhost:1469/api/Smartling/" + fileID + "/"+jsonData)
.ContinueWith((taskwithresponse) =>
{
var response = taskwithresponse.Result;
var jsonString = response.Content.ReadAsStringAsync();
jsonString.Wait();
var getVal = jsonString.Result;
});
task.Wait();
}
in the above code if i am passing instead of json data it's giving error response code 400 Bad Request.
same I used with jQuery ajax call and it's working fine no issues.
How to pass JSON data as parameter?