Hello All,
I am finding difficulty while using web api. Actually I want to send the xml file OR its content in String format to web api controller method. Below is my code
Client Side
try
{
url="http://localhost/ATS.RCWebService4/api/RequisitionCandidate/CreateRequisition";
string str = string.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.KeepAlive = true;
request.ProtocolVersion = HttpVersion.Version10;
request.ContentType = "application/xml";
request.Method = "POST";
request.Timeout = timeout;
//request.Accept = "application/xml";
byte[] postBytes = Encoding.UTF8.GetBytes(xml);
request.ContentLength = postBytes.Length;
Stream requestStream = request.GetReq ...
Go to the complete details ...