<blockquote class="quote"><div class="op">Quote:</div>Here is my Client side code I am sending request. urlstring = @"api/home/CopyHotFolders?folderName=new&virtualPrName=FieryDemo print&isHotFolderEnabled=true"; var response = client.GetAsync(urlstring).Result; if (response.IsSuccessStatusCode) { string data = await response.Content.ReadAsStringAsync(); } here I am getting response "data" . that data I am trying to send request to the server using below code. StringContent httpContent = new StringContent(data, Encoding.UTF8, "text/json"); var serverAddress2 = string.Format(System.Globalization.CultureInfo.InvariantCulture, "http://{0}/", serverIP + ":5555"); using (var client2 = new HttpClient()) { client2.BaseAddress = new Uri(serverAddress2); urlstring = @"api/home/CopyHotFolderToDestination?folderName=xyz&virtualPrName=FieryDemo print&IsDefault=true"; HttpResponseMessage response2 = await client2.PostAsync(new Uri(urlstring, UriKind.Relative), httpContent); if (response2.IsSuccessStatusCode) { string data2 = await response2.Content.ReadAsStringAsync(); } // ...web api is like this........... [AcceptVerbs("POST")] [HttpPost] [Route("api/home/{CopyHotFolderToDestination}")] public HttpResponseMessage CopyHotFolderToDestination(string folderName, string virtualPrName, bool IsDefault) { string xmlData; HttpResponse request = HttpContext.Current.Response; string httpContent = Request.Content.ReadAsStringAsync().Result; xmlData = request.ToString(); StringContent xmlvalue = new StringContent(JsonConvert.SerializeObject(xmlData), Encoding.UTF8, "application/json"); return new HttpResponseMessage() { Content = xmlvalue }; } I am getting response like this ."\"System.Web.HttpResponse\"" instead of my xmldata. I need my xml data which I am sending to the server.</blockquote>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)