http-headers

how to construct an https POST request with drupal_http_request?

自作多情 提交于 2019-12-06 08:28:41
问题 I want to send a POST request to an https server. $data = 'name=value&name1=value1'; $options = array( 'method' => 'POST', 'data' => $data, 'timeout' => 15, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'), ); $result = drupal_http_request('http://somewhere.com', $options); I can't figure out out to implement the https options in the POST example code above. Can anyone please explain me how to do this? I am quite new to PHP coding with Drupal, and I could definitely

CORS Issue When Requesting from ExtJS to node.js. Request or Response Header Incorrect?

旧时模样 提交于 2019-12-06 08:14:07
问题 I am having issues with making an ExtJS AJAX request to the Nodejs server between two different domains within our network and will appreciate any help. Response fails when attempting from both http and https from ExtJS client side but a Curl from my local via http returns 200 OK with proper data. We are working with content type application/json . ExtJS onReady function has enabled CORS: Ext.onReady(function () { Ext.Ajax.cors = true; Ext.Ajax.useDefaultXhrHeader = false; ... (code removed)

How to check contents of incoming HTTP header request

那年仲夏 提交于 2019-12-06 08:09:55
问题 I'm playing around with some APIs and I'm trying to figure this out. I am making a basic HTTP authenticated request to my server via the API. As part of this request, the authenticated key is stored in the HTTP header as username. So my question is, how do I get the contents of the incoming request such that I can perform a check against it? What I am trying to do: if incoming request has header == 'myheader': do some stuff else: return ('not authorised') For those interested, I am trying to

How to log SOAP messages & HTTP headers programmatically in server or client side?

丶灬走出姿态 提交于 2019-12-06 07:54:52
问题 Been searching for long on this and testing. I want simply to log SOAP message details and the transport protocol request/response (header) along with it. What I've found so far : - Handlers .. to output the soap messages as raw xml on console output this is very good solution. However, for HTTP header ( MimeHeaders used) it seems the output is too little. For example on client I get only Accept : text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Content-Type : text/xml; charset

php, curl, headers and content-type

不羁岁月 提交于 2019-12-06 07:14:40
I am having some trouble working with curl and headers returned by servers. 1) My php file on my_website.com/index.php looks like this (trimmed version): <?php $url = 'http://my_content_server.com/index.php'; //Open connection $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //execute post $result = curl_exec($ch); //close connection curl_close($ch); echo $result; ?> The php file on my_content_server.com/index.php looks like this: <?php header("HTTP/1.0 404 Not Found - Archive Empty"); echo "Some content > 600 words to make chrome/IE happy.....

Can't use custom Request Headers on AWS API Gateway with CORS

扶醉桌前 提交于 2019-12-06 07:11:53
I have created and deployed an AWS API Gateway resource with the following structure including a custom HTTP Request Header 'X-header' dev (stage) /echo (resource) POST (method) Method Request - Headers: X-header OPTIONS (method) Method Request - Headers: X-header When I POST to the endpoint from Chrome, I get the following error. XMLHttpRequest cannot load https://fxxxx.execute-api.us-west-2.amazonaws.com/dev/echo . Request header field X-header is not allowed by Access-Control-Allow-Headers in preflight response. Chrome is doing a preflight check against the OPTIONS method. I can see the

Remove CORS Accept-Encoding header on Safari

…衆ロ難τιáo~ 提交于 2019-12-06 07:03:30
问题 I made a javascript bookmarklet which accesses byte-shuffled images (whence I make ArrayBuffer CORS) on a publicly shared google-drive folder. Works great on Firefox, Chrome, Opera, and even Safari 5.something (I run on windows). However, one user told me it didn't work on Safari 7.0.3 (and I don't know if it works in Safari 6.something). From what I understand the request cannot load because Safari adds an "Accept-Encoding" into the preflight, while google's Access-Control-Allow-Headers

With the AWSiOS SDK how do you do a HEAD request on an S3 object?

别说谁变了你拦得住时间么 提交于 2019-12-06 06:22:37
I'm looking to use the SDK (can't use ASI) to do HEAD requests on objects before I download them to determine the size. Is there a provided way to do this I'm overlooking, or am I forced to build up my own S3Request, setting the httpMethod property to be "HEAD" and passing the constructed S3Request to the invoke: method of AmazonS3Client ? Building the request myself gets a little dicey as I'm using federated users, so I wanted to make sure I wasn't duplicating something I had overlooked. I am a maintainer of the AWS SDK for iOS. You can also use the S3GetObjectMetadataRequest to do the same

Access-Control-Expose-Headers setting ignored

血红的双手。 提交于 2019-12-06 06:02:06
In my Apache web server configuration, I add support for two headers that are not part of the standard six: Header set Access-Control-Allow-Origin "*" Header set Access-Control-Expose-Headers: Content-Disposition,X-Filename My file export CGI script prints headers containing data for these two fields, e.g.: ... print "Content-Disposition: attachment; filename=%s\n" % (out_fn) print "X-Filename: %s\n" % (out_fn) ... My client-side AJAX call tries to retrieve the value of Content-Disposition on a successful AJAX request: var export_form = new FormData(); export_form.append("settings", JSON

How to cache api response using curl, based on returned etag?

孤街浪徒 提交于 2019-12-06 05:47:10
This is a quick question that might help other too. I have a rest service that will return a proper ETAG header for each GET query on it's endpoints. Now, i also need to create a curl http client to query these endpoints and make use of the etags. From my understanding, after making the first request with curl, i need to save the returned etag for later use, so that on all subsequent requests (till the etag invalidates on server) i use the cached version because the server will return a 304 header and an empty response. Is this correct? Having in mind that this http client will be distributed