I'm using RestClient and redirecting the request to external REST webservice (java) as RestRequest. I'm getting HTTP statuscode 'not acceptable' and also the repsonse.content is something like this "The resource cannot be displayed because the file extension is not being accepted by your browser." the operation is successful but not able to get the required response which is nothing but a string value.
below is code snippet:
var client = new RestClient();
client.BaseUrl = JavaWSURI;
var request = new RestRequest();
//request.AddHeader("Content-Length", int.MaxValue.ToString());
//request.AddHeader("Content-Type", "text/html; charset=utf-8");
// jsonD is JSON input object
request.AddParameter("application/json", jsonD, ParameterType.RequestBody);
request.Method = Method.POST;
request.RequestFormat = DataFormat.Json;
// The server's Rest method will probably return something
var response = client.Execute(request) as RestResponse;
From the error message, it sounds like you may need to add an 'Accept' header to the request