http-headers

Keeping HTTP Basic Authentification alive while being redirected

牧云@^-^@ 提交于 2020-01-11 05:20:06
问题 We are using web service with basic authentication. It all worked all fine, till owners of web service implemented balancing service. Which is simply redirects requests to different instances of web service. The problem is that after being redirected basic authentication fails. There is "request authentication credentials was not passed" exception. Additional info: We have to create request manually. var req = (HttpWebRequest)WebRequest.CreateDefault(new Uri(Settings.Default

Keeping HTTP Basic Authentification alive while being redirected

醉酒当歌 提交于 2020-01-11 05:20:05
问题 We are using web service with basic authentication. It all worked all fine, till owners of web service implemented balancing service. Which is simply redirects requests to different instances of web service. The problem is that after being redirected basic authentication fails. There is "request authentication credentials was not passed" exception. Additional info: We have to create request manually. var req = (HttpWebRequest)WebRequest.CreateDefault(new Uri(Settings.Default

How to parse response headers in PHP?

被刻印的时光 ゝ 提交于 2020-01-11 05:04:30
问题 I have made an oauth signed request to a REST API and have the response headers in an array like so: [0] => HTTP/1.1 200 OK [1] => Cache-Control: private [2] => Transfer-Encoding: chunked [3] => Content-Type: text/html; charset=utf-8 [4] => Content-Location: https://*** [5] => Server: Microsoft-IIS/7.0 [6] => Set-Cookie: ASP.NET_SessionId=***; path=/; HttpOnly [7] => X-AspNetMvc-Version: 2.0 [8] => oauth_token: *** [9] => oauth_token_secret: *** [10] => X-AspNet-Version: 4.0.30319 [11] => X

Jquery File Upload - Not sending headers in IE9

雨燕双飞 提交于 2020-01-11 02:20:36
问题 I'm using jQuery Fileupload to upload files. Its not sending headers that I set to the server. Why is the Authorization header missing only in IE but passed in chrome? Here is the code: upload_photo: function(){ var url = '/api/v1/upload'; $('#photoupload').fileupload({ url: url, dataType: 'json', paramName: 'uploadFile', beforeSend: function ( xhr ) { setHeader(xhr); $("#check_progress").html('true'); }, done: function (e, responseJSON) { var id = responseJSON.result.id; url = responseJSON

sending xml and headers via curl

孤人 提交于 2020-01-09 11:47:10
问题 wondering how I can set all this data in a curl session, via php: POST /feeds/api/users/default/uploads HTTP/1.1 Host: uploads.gdata.youtube.com Authorization: AuthSub token="DXAA...sdb8" GData-Version: 2 X-GData-Key: key=adf15ee97731bca89da876c...a8dc Slug: video-test.mp4 Content-Type: multipart/related; boundary="f93dcbA3" Content-Length: 1941255 Connection: close --f93dcbA3 Content-Type: application/atom+xml; charset=UTF-8 <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom"

Header names with underscores ignored in php 5.5.1 / apache 2.4.6

混江龙づ霸主 提交于 2020-01-09 09:33:10
问题 After upgrading to php 5.5.1 and apache 2.4.6, checking for certain headers is now broken (specifically, checking for HTTP_X_REQUESTED_WITH ). Through further testing I noticed that any custom header that contains an underscore is ignored (by this I mean it does not show up in PHP's $_SERVER array). So if I add a header named my-header , it becomes available as $_SERVER['HTTP_MY_HEADER'] , but if I try adding a header my_header , it's not available in $_SERVER . 回答1: This is a documented

How can I set a cookie and then redirect in PHP?

一个人想着一个人 提交于 2020-01-08 21:42:35
问题 After doing a bit of processing, I want to set a cookie value to user input and then redirect them to a new page. However, the cookie is not getting set. If I comment out the redirect, then the cookie is set successfully. I assume this is a header issue of some sort. What is the best workaround for this situation? if($form_submitted) { ... setcookie('type_id', $new_type_id, time() + 60*60*24*30); header("Location: $url"); exit; } Note that setcookie returns true in either case and I get no

How can I set a cookie and then redirect in PHP?

风流意气都作罢 提交于 2020-01-08 21:38:41
问题 After doing a bit of processing, I want to set a cookie value to user input and then redirect them to a new page. However, the cookie is not getting set. If I comment out the redirect, then the cookie is set successfully. I assume this is a header issue of some sort. What is the best workaround for this situation? if($form_submitted) { ... setcookie('type_id', $new_type_id, time() + 60*60*24*30); header("Location: $url"); exit; } Note that setcookie returns true in either case and I get no

Get and store cookie (from Set-Cookie) from an AJAX POST response

一曲冷凌霜 提交于 2020-01-08 17:19:33
问题 I have a simple jQuery AJAX POST code: $.ajax({ type: "POST", url: AppConstants.URLs.PROXY, data: message, xhrFields: { withCredentials: true }, success: function(data, status, xhr) { console.log("Cookie: " + xhr.getResponseHeader("Set-Cookie")); } }); and I wish to get the cookie and save it using cookies-js. But according to http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders%28%29-method: Return all response headers, excluding headers that are a case-insensitive match for Set

Get and store cookie (from Set-Cookie) from an AJAX POST response

纵饮孤独 提交于 2020-01-08 17:19:28
问题 I have a simple jQuery AJAX POST code: $.ajax({ type: "POST", url: AppConstants.URLs.PROXY, data: message, xhrFields: { withCredentials: true }, success: function(data, status, xhr) { console.log("Cookie: " + xhr.getResponseHeader("Set-Cookie")); } }); and I wish to get the cookie and save it using cookies-js. But according to http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders%28%29-method: Return all response headers, excluding headers that are a case-insensitive match for Set