Q: Return an HttpResponse in an APIController Method which calls a different API I have an APIController Method as below. Basically I need to validate an API response. So it's an API call within an API call.
   public class DCController : ApiController
    {    
        [HttpPost]
        public HttpResponseMessage SampleMethod(string url)
        {

            var uri = new Uri(url);

            var baseAddress = uri.GetLeftPart(System.UriPartial.Authority);
            var apiAddress = url.Replace(baseAddress + "/", "");

            var responseString = string.Empty;

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(baseAddress);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                var response = client.GetAsync(apiAddress).Result;
                if (response.IsSuccessStatusCode)
                {
                    responseString = response.Content.ReadAsStringAsync().Result;
                }
            }


            if (!string.IsNullOrEmpty(responseString) && responseString.ToString().Validate())
            {

                return Request.CreateResponse(HttpStatusCode.OK, "Validated");
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Invalid");
            }
        }

Issue:
1. Request object is null in the return lines.
2. If i try creating a request object - 
var request = new HttpRequestMessage();

It throws below error:

An exception of type 'System.InvalidOperationException' occurred in
  System.Web.Http.dll but was not handled in user code
Additional information: The request does not have an associated
  configuration object or the provided configuration was null.

Not sure what settings I need to add. I am relatively new to working with APIs. Any help is appreciated. 

A: I could get it working by below code -
 [HttpPost]
        public HttpResponseMessage Get(string url)
        {
            string responseString = GetWebApiData(url); //Extracted the method

            HttpResponseMessage response = new HttpResponseMessage();

            if (!string.IsNullOrEmpty(responseString) && responseString.ToString().Validate())
            {
                response.ReasonPhrase = "Valid";
                response.StatusCode = HttpStatusCode.OK;
            }
            else
            {
                response.ReasonPhrase = "Invalid";
                response.StatusCode = HttpStatusCode.BadRequest;
            }

            return response;
        }

