response-headers

How can I send back response headers with Node.js / Express?

十年热恋 提交于 2020-01-01 07:45:11
问题 I'm using res.send and no matter what, it returns status of 200. I want to set that status to different numbers for different responses (Error, etc) This is using express 回答1: res.writeHead(200, {'Content-Type': 'text/event-stream'}); http://nodejs.org/docs/v0.4.12/api/http.html#response.writeHead 回答2: For adding response headers before send, you can use the setHeader method: response.setHeader('Content-Type', 'application/json') The status only by the status method: response.status(status

Content-Disposition inline filename issue with IE

扶醉桌前 提交于 2019-12-30 06:45:53
问题 I am displaying a pdf in browser with inline from API using an aspx page. While saving the pdf using Chrome/Firefox, takes the filename from header("Content-Disposition", "inline;filename=xyz.pdf") But while saving the pdf using IE it does not reads the filename from header("Content-Disposition", "inline;filename=xyz.pdf") . instead it takes the aspx name. Technical details I have an xyz.aspx page. The xyz.aspx page will invoke an API for a document. Then the downloaded document from API will

Content-Disposition inline filename issue with IE

妖精的绣舞 提交于 2019-12-30 06:45:26
问题 I am displaying a pdf in browser with inline from API using an aspx page. While saving the pdf using Chrome/Firefox, takes the filename from header("Content-Disposition", "inline;filename=xyz.pdf") But while saving the pdf using IE it does not reads the filename from header("Content-Disposition", "inline;filename=xyz.pdf") . instead it takes the aspx name. Technical details I have an xyz.aspx page. The xyz.aspx page will invoke an API for a document. Then the downloaded document from API will

angularJS response header access returns null in Safari Browser

自古美人都是妖i 提交于 2019-12-25 06:38:24
问题 After $http request in angularJS, I could see any header sent with response in safari "Web Inspector" (OS: Windows 8). But same when I try to access like headers('Authorization') in angularJS , it returns null . Tried by setting custom headers also, but when I access, I get null value. Our application login happens by validating the authorization header. Since it is returning null in Safari browser, not able to login only :(. Anyone has come across this Safari browser issue and got solution?

HTTP Header in Response exists with a CURL request but not with Browser request

…衆ロ難τιáo~ 提交于 2019-12-25 04:27:46
问题 When I run cURL on an object to see its HTTP response headers (I just added agent flag to emulate a browser request): curl -I -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36" http://b17db03a092ebf708b42-9afd7fe2d9c9c6937aeab44904ac3403.r3.cf5.rackcdn.com/artist/samplesong/13111c20aee51aeb480ecbd988cd8cc9.mp3 I have: HTTP/1.1 200 OK Content-Length: 481005 Accept-Ranges: bytes Last-Modified: Tue, 08 Sep 2015 18:37:54

I am getting same version name for WSS and MOSS 2007?

白昼怎懂夜的黑 提交于 2019-12-24 10:00:13
问题 I am getting same version name for WSS and MOSS 2007? response = urllib2.urlopen(url) print response.info().getheader('MicrosoftSharePointTeamServices') I am using the above python code to get the verion of the sharepoint verion using the site URL. WSS:MicrosoftSharePointTeamServices: 12.0.0.4518 MOSS:MicrosoftSharePointTeamServices: 12.0.0.4518 SP2010:MicrosoftSharePointTeamServices: 14.0.0.4762 So i am confused now because for MOSS and WSS it return the same version id.Why its happening how

Can we add http response headers directly into html pages

此生再无相见时 提交于 2019-12-24 03:48:10
问题 I need to add response headers like X-Frame, Cache-control, Pragma etc directly into the html code, may be, using attributes in html elements? It is for help pages which are directly coming from a directory via href link. Is there any way to add headers to these htmls? 回答1: You can use meta to replicate some of these. Normally not the ideal solution, but look into the http-equiv attribute of meta tags. I believe a lot of these have been deprecated in newer browsers. Examples: <meta http-equiv

Servlet Response wrapper to add getHeaderNames and getHeaders methods to Servet 2.4 spec container not working

≡放荡痞女 提交于 2019-12-24 00:47:47
问题 Since Servlet 3.0 , HttpServletResponse#getHeaderNames() and HttpServletResponse#getHeaders() has been available. However, I'm using an older spec, specifically Servlet 2.4 . Having looked at the resource, How can I get the HTTP status code out of a ServletResponse in a ServletFilter?, I got an idea of how to write a wrapper. If I understand it right, I have to use setHeader() to facilitate the creation of getHeaderNames() and getHeaders() . I think I have a solid footing on how to store the

How to read HTTP response headers from web service response?

大城市里の小女人 提交于 2019-12-23 23:06:27
问题 How can I read the HTTP response headers from a web service response in C#? 回答1: After digging through MSDN, all I needed to do was to override the GetWebResponse method, and then I could access the response headers: public class MyWSProxy : HttpWebClientProtocol { protected override WebResponse GetWebResponse(WebRequest request) { System.Net.WebResponse wr = base.GetWebResponse(request); // read a response header object val = wr.Headers["key"]; return wr; } } 回答2: If you're getting back an

Changing Tomcat server name in response header, is that possible?

感情迁移 提交于 2019-12-22 08:04:17
问题 When a http request from a browser is made, typically the server container will send along in the header what server it was. For tomcat it sends Server:Apache-Coyote/1.1 I know I can overwrite this header, for each request, but there is also the case for websockets and potentially other connections. So, is there a way to change this at the tomcat configuration level? 回答1: I just found this after posting the question: Add this to server.xml in tomcat config folder. <Connector port="8080"