Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Request is Null in HttpResponseMessage

$
0
0

I am using System.Web.Http version 5.2.3.0 and .NET version 4.5.2

       public HttpResponseMessage GET(string EnteredVariable)
        {

                Data DataModel = new Data();
                
                    using (DataTable aDataTable = DataRepository.GetDataByQualifier(EnteredVariable))
                    {
                        foreach (DataRow ReturnedData in aDataTable.Rows)
                        {
                            DataInfo DataName = new Models.DataInfo();
                            ...Populate data items ...
                            DataModel.DataList.Add(DataName);
                        }
                    }
                
                else
                {
   

               using (HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, DataModel))
                {
                    return response;
                }
            }

In the code above Request is null...I'm not sure how this can be since it is part of ApiController...this problem seems to have cropped up using .NET4.5.2 but I'm not positive because there really is no error besides Request being Null...


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>