http-headers

Type of “application/json” prevents post variables from being sent

こ雲淡風輕ζ 提交于 2019-12-19 04:00:09
问题 I've found that if I try a PHP POST curl, the postvars are sent fine. Once I add the httpheader of content-type: application/json the postvars don't go across any more. I've tried the postvars as a JSON string and as a query string. Showing some code: $ch = curl_init(); $post = json_encode(array('p1' => 'blahblahblah', 'p2' => json_encode(array(4,5,6)))); $arr = array(); array_push($arr, 'Content-Type: application/json; charset=utf-8'); curl_setopt($ch, CURLOPT_HTTPHEADER, $arr); curl_setopt(

Basic Authentication with RestTemplate - compilation error - The constructor HttpClient() is not visible

十年热恋 提交于 2019-12-19 03:58:45
问题 trying to add basic auth to restTemplate problem I encounter is that i cant initialize : (with both the imports in the code snippet) HttpClient client = new HttpClient(); This code resolves in a compilation error (with no suggestion available from eclipse to fix this issue) 1) what is the problem ? 2) Am i importing the wrong class ? my code snippet : import org.apache.http.client.HttpClient; //OR (not together) import sun.net.www.http.HttpClient; HttpClient client = new HttpClient(); //this

WCF Service with wsHttpBinding - Manipulating HTTP request headers

走远了吗. 提交于 2019-12-19 03:44:13
问题 I have been following this tutorial in order to get username authentication with transport security working in my WCF service. The tutorial however refers to using basicHttpBinding which is unacceptable - I require wsHttpBinding . The idea is to have a custom BasicAuthenticationModule on WCF service which would read the "Authorization" header from the HTTP request and perform the auth process according to "Authorization" header contents. The problem is that "Authorization" header is missing!

Do not propagate headers on HTTP redirects

只愿长相守 提交于 2019-12-19 03:02:31
问题 I have files hosted on Amazon S3, and I'd like to download them after a treatment in my app. This app view requires the HTTP Authorization header to proceed. Here is the process: Query view /file/xxx with the required Authorization request header If the app access is granted, does some treatment Generate a signed S3 url, and redirect to it The fact is that the request header is also propagated on the redirect, and is in conflict with Amazon's S3 signature, I have the following error message:

Generating HTTP multipart body for file upload in JavaScript

自古美人都是妖i 提交于 2019-12-19 01:00:06
问题 I'm trying to build HTTP multipart form data in JavaScript (on the server for Meteor.js HTTP request). Here is the Meteor code that sends POST request. var res = HTTP.post(url, { headers: formatted.headers, content: formatted.content }); I'm preparing headers and content using this code. function MultipartFormData(parts) { var boundary = (new Date()).getTime(); var bodyParts = []; _.each(parts, function (value, key) { value.data = (new Buffer(value.data)).toString('binary'); bodyParts.push( '

Nginx upstream sent too big header while reading response header from upstream

这一生的挚爱 提交于 2019-12-18 20:04:33
问题 I get error like this: [error] 27544#0: *47335682 upstream sent too big header while reading response header from upstream, client: 88.88.88.88, server: example..com, request: "POST /tool/ HTTP/1.1", upstream: "http://88.88.88.88:7080/tool/", host: "example.com" Regarding to this question, it is possible to increase buffer size from nginx conf file like this: upstream sent too big header while reading response header from upstream http { proxy_buffer_size 128k; proxy_buffers 4 256k; proxy

HTTP “Expires” header does not work in Chrome

最后都变了- 提交于 2019-12-18 18:55:32
问题 My system is Windows 7 x64, Chrome 20.0.1132.57 m. In my HTTP response header, I have: Cache-Control: public, max-age=1000 Expires: *some date* In IE & FF, the page is cached in local, and when I try to access again by typing the URL and hit enter, no request is send and the page is displayed correctly. But in Chrome, it always send a request to the server with the following header: Cache-Control: max-age=0 I do not want the client send a request to my server and then reply 304. I want to

Why isn't the Referral Removed for Google HTTPS -> HTTP

半世苍凉 提交于 2019-12-18 17:58:10
问题 Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was transferred with a secure protocol. https://tools.ietf.org/html/rfc2616#section-15.1.3 According to the standard, https://google.com shouldn't send the referral to non-secure sites, but it does. Do other HTTPS sites send the referral to HTTP sites? All these tests are done using Chrome v33.0.1750.117 To run the test I go to the first page, then open the console and manually do a redirect

PHP Header Location with parameter

雨燕双飞 提交于 2019-12-18 17:57:29
问题 Is it possible to append a parameter to a PHP Header Location? I'm having trouble getting it to work. Is this syntax actually allowed? $qry = $_SERVER['QUERY_STRING']; header('Location: http://localhost/blast/v2/?$qry ') ; it just won't replace $qry wit its actual value....why?? in the browser it ends up looking like this: http://localhost/blast/v2/?$qry thanks 回答1: Change the single quotes to double quotes: header("Location: http://localhost/blast/v2/?$qry"); A single quoted string in PHP is

PHP Header Location with parameter

为君一笑 提交于 2019-12-18 17:57:22
问题 Is it possible to append a parameter to a PHP Header Location? I'm having trouble getting it to work. Is this syntax actually allowed? $qry = $_SERVER['QUERY_STRING']; header('Location: http://localhost/blast/v2/?$qry ') ; it just won't replace $qry wit its actual value....why?? in the browser it ends up looking like this: http://localhost/blast/v2/?$qry thanks 回答1: Change the single quotes to double quotes: header("Location: http://localhost/blast/v2/?$qry"); A single quoted string in PHP is