I have a REST service using Web API 2.0 and MVC 5. My controller derives from EntitySetController. I have a Get method that returns the resource as an IQueryable. My question is how do I access the HttpResponseMessage object from within the Get function so that I can set some header values like the TransferEncodingChunked = true.
Set HttpResponseMessage headers from within the Get method of my controller
409 Views Asked by Saurabh At
1
There are 1 best solutions below
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in ODATA
- kendo - datasource - parameterMap does not bind parameters
- Creating Odata Web API application without Entity Framework
- ASP.NET Odata Web API Composable function issue
- What the format should look like for a Function Import Response which returning a simple type?
- Web API: Odata route always returning a 404 response
- Odata post always returns "HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed,"
- solution architecture for an OData / Web API based .Net project
- WCF Data Services, WindowsAzure.Storage and Microsoft.Data.OData version nightmare
- How to wisely combine shingles and edgeNgram to provide flexible full text search?
- Connect to SharePoint Lists with OData
- Freeze a linq IQueryable (as a ToList().AsQueryable() would do)
- Can I create a file to subdirectory on OneDrive for Business with REST API?
- Simple.OData.Client - Unable to invoke Action that accepts entity collection parameter
- oData deserialization issue in application
- Accessing JSON object in SAPUI5 via xsodata
Related Questions in TRANSFER-ENCODING
- NSURLConnection response's expectedContentLength -1
- Header Content-Length not getting in rest web service using php
- PHP ob_gzhandler, setting Content-Length disables gzipped output
- how to send multipart/alternative email with PHP correctly
- Http server in c# supporting chunked Transfer-Encoding
- content-length header in response not present despite commenting transfer-encoding in axis2.xml
- Transfer-encoding: chunked and MP3/Lame
- Chunked transfer-encoding in django rest framework (nginx+gunicorn)
- How to break bigger chunk into smaller ones to fit into max chunk?
- Prevent HTTP Request Smuggling in Netty-4.1.96
- Decoding HTTP chunked + gzipped content
- Downloading a file with transfer-encoding header on android
- How to allow downloading huge file in a website only after authentication?
- HTTP/1.1 request with body and without content-type
- How to handle Transfer-Encoding: chunked when downloading a file with .NET Core HttpClient.PostAsync
Related Questions in ASP.NET-APICONTROLLER
- .NET MVC controllers and API controllers in the same project
- ASP.NET API Controller method custom route - Include current URL
- How to parse a PartialView and return a Html string from ApiController?
- How can a ApiController Post return a response?
- need route for my web api 2 controller
- C# EF API Controller Not Loading Many to Many Array
- Adding security to RESTful API
- .ToList on IQueryable causes NullReferenceException when executed in background
- Error using MvxMultiPartFormRestRequest to post image/data to API controller
- MVC instrumentation & WebApi attribute routing for Sitecore 7.5
- Resolving from Castle Windsor container in an API controller
- Access Client certificate in ApiController hosted in Azure Worker Role
- AngularJS Post data to WebAPI using $resource
- How to pass image from Angular(2/4) to in ASP.NET Core WebAPI server folder
- Cost of using multiple filter attributes on an action method
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You could try returning HttpResponseMessage instead and specify return code like that: