http-headers

Replicating HTTP requests with PHP & cURL

有些话、适合烂在心里 提交于 2019-12-06 16:01:07
I am trying to request a password protected page from something called "CM/ECF" (Pacer) to view court dockets and such with PHP/cURL. I am using a FireFox extension called Tamper Data which allows me to see headers and POST data, then trying to replicate that request PHP using cURL. It's not working for some reason, I keep getting a request to log in. I can log in just fine, save the cookie to the cookie jar and get the the "Main" page, but when I do a second curl call (sending the same cookie) to the search page the host redirects me to a login page. Two part question: Part 1 - When I use

Pragma no cache and javascript

荒凉一梦 提交于 2019-12-06 15:45:21
Does the pragma no-cache mean the browser will not cache javascript scripts? e.g. Will the pragma no cache tag stop the browser from caching the jquery script? BalusC Actually, that depends on the browser used. For modern browsers you need to add Cache-Control and Expires headers as well. response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); See also: How to control web page caching, across all browsers? 来源: https://stackoverflow.com/questions/6208715/pragma-no-cache-and-javascript

PHP Connection: Close

一笑奈何 提交于 2019-12-06 15:21:11
I have a PHP application that I have been having some problems with, some pages take a very long time to load. After a couple of hours I have figured out the problem, but I have no idea how to fix it. The problem seems to be with the header Connection: keep-alive . I used a Firefox plugin called "Tamper Data" which allows you to "tamper" with the headers and stuff. Once I used that tool to change the connection header to Connection: close the delay on some pages stopped. How, in PHP, can I make sure that the Connection: close header is used? I tried putting header("Connection: close"); at the

How can i modify the host header

烂漫一生 提交于 2019-12-06 14:18:35
I am trying to develop a chrome extension that would set the "host" header on certain requests. But the documentation is contradicting as to if the "host" header can be modified or not. Both of these issues indicate that a) it should not be possible and b) it is impossible https://code.google.com/p/chromium/issues/detail?id=154900 https://code.google.com/p/chromium/issues/detail?id=158073 Yet multiple extensions in the gallery state they do modify the "host" header. e.g. https://chrome.google.com/webstore/detail/header-hacker/phnffahgegfkcobeaapbenpmdnkifigc?hl=en https://chrome.google.com

How to set custom HTTP response header in Wicket's Ajax responses?

☆樱花仙子☆ 提交于 2019-12-06 14:04:01
I need to set a custom HTTP header to all responses from my Wicket application. I'm currently doing it in a custom RequestCycle, where getWebResponse() is overridden along these lines: @Override public WebResponse getWebResponse() { WebResponse response = super.getWebResponse(); response.setHeader("X-custom", "..." ); return response; } This has worked great, until now that I've switched to using AjaxCheckBox ( something like this ) instead of normal CheckBox for certain configuration options. My question is, is there an easy way to include my custom header also in Wicket's Ajax responses ?

Leverage browser caching not working - Htaccess & mod_expires Active

假如想象 提交于 2019-12-06 13:46:12
I´ve been trying to get The leverage browser cache for quite a while and I have no idea what could be the problem. I tried several methods to activate it, but nothing works... The site is running on Namecheap Hosting. I already contacted the support and asked if the mod_expires module is active and according to the customer support it is... This is the code I´ve been using: # START --- Browser Cache Control # Turn on Expires and set default to 0 ExpiresActive On ExpiresDefault A0 # Set up caching on media files for 1 year (forever?) <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">

Advice on HTTP authentication scheme (using request headers)

删除回忆录丶 提交于 2019-12-06 12:45:22
I have a rails app hosted on Heroku that am restricting access to by using a proxy service. The external server acts as intermediary for all requests and handles user authentication. Once a user has authenticated, the server (I think LDAP) adds the user name to the request header and redirects them to my app. I would like to use the username from the request header to authenticate users in my app. Basically if the user doesn't exist I would create a user with that username (no password required) and if not I would just log them in. I will be storing the users in my app's database. How should I

Forcing intranet users to view webpage in IE8 mode, not compatibility mode [duplicate]

与世无争的帅哥 提交于 2019-12-06 12:25:14
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Override intranet compatibility mode IE8 Although I'm specifying <meta http-equiv="X-UA-Compatible" content="IE=8" /> But due to IE's "Display intranet sites in Compatibility View" setting, my app isn't being viewed in IE8, but in compatibility mode. Anyone know if there is a way round this??? 回答1: This will help you. if (window.navigator.appName == "Microsoft Internet Explorer"){ // This is an IE browser. What

PHP cURL: Read a specific response header

谁都会走 提交于 2019-12-06 12:11:18
I am using cURL in PHP to POST to an endpoint that is creating a resource. It returns a 201 response with a Location header giving the URL of the resource created. I also get some information in the body of the response. What's the best way to get the plain-text body of the response, and also get the value of the location header? curl_getinfo doesn't return that header, and when I do this: curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($ch, $header) { var_dump($header); }); I only see one header dumped out--the "HTTP/1.1 201 Created" response code. $ch = curl_init(); curl_setopt($ch,

Using XMLHttpRequest without CORS by modifying HTTP headers?

岁酱吖の 提交于 2019-12-06 11:56:24
问题 I'm doing some tests with the (deprecated) Twitter API 1.0 For example, I want to get data from the API, client-side using AJAX browser requests from any cross-origin webpage. It can be a new blank tab, a local HTML page or any existing website. I've tried JSONP, it works great but I would like to use the default XMLHttpRequest even if Twitter servers do not support CORS http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing. On google.com homepage for example, I create a simple AJAX call