Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [http-request]

Use it for the Drupal API used to perform a HTTP request.

1
vote
1answer
43 views

Handling access denied result

In Drupal 8, what is the correct way of returning access denied to a user (outside of access requirement on a controller)? I'd say it is to throw an AccessDeniedHttpException most of the time, but I ...
0
votes
0answers
23 views

Rest export contextual filter by taxonomy name

good night developers!. I have a view of a chapter content type and a relationship with the taxonomy term book. I can add any field from the taxonomy, but can not include the relationship in the ...
0
votes
0answers
10 views

Why drupal_http_request returns a 2000 in the data array

I'm using drupal 7 and calling drupal_http_request which returns some JSON data with GET. However I'm getting data => 2000 followed by the JSON. I'm not sure why I'm getting a 2000 first. the data ...
0
votes
1answer
16 views

POST from external source

I have external site that needs to POST my drupal site (it basically shares data). I need to take the POST data parse it and create a node from it. Is this possible? I have created a PHP file ...
0
votes
1answer
106 views

Setting exposed filter default value from query string

I have a view which show products and an exposed filter block (category, manufacturer, price). I want to set category default value from URL, like this: /browse-products/category-id though, I wrote ...
0
votes
0answers
21 views

Rules replacement pattern dependent on data type, how do I add replacement patterns from other datatypes?

I want a rule to trigger a POST REST API call, and when defining action I need to define all my parameters in the url field (with Rules HTTP Client). However I can only use replacement patterns for ...
0
votes
2answers
103 views

Drupal 7 - Cors

I'm trying to get a hang of the CORS requests. I'm logged in at the website, this is done manually from the website. Now I'm trying to fetch my own user data from another website. I have the "fetch ...
0
votes
1answer
35 views

How to remove any data “http_proxy” module added or changed?

I have a serious problem with a broken XML-Feed, that occurred after I installed http_proxy module. I have uninstalled the module, cleared the cache several times and even truncated the cache tables ...
2
votes
1answer
1k views

8 - Alter HTTP Response Headers

I noticed this question, which discusses various ways to alter HTTP Response Headers. Where would I be able to execute: $response->headers->remove('X-Frame-Options'); I attempted to place ...
1
vote
1answer
718 views

How do I pass parameters as JSON format to the HTTP client request?

How can I pass parameters to the http client get request in json format: $clientFactory = \Drupal::service('http_client_factory'); $client = $clientFactory->fromOptions(['verify' => FALSE]); $...
0
votes
2answers
52 views

How can I login to my local drupal site 8.3.1 which was under maintence mode [duplicate]

I just logout to see what will the home page look like. Now, I can't login into my local site.
1
vote
1answer
21 views

Validation Users Issues

I have my fresh web site up and running. My first test is to try the functionality of creating a new user. I tested added myself (no, not my admin account -- a different one with a different email ...
1
vote
1answer
553 views

Page redirect based on referrer

I am looking for an option to redirect user referred from a specific url (say abc.com) to domain.com/abc in Drupal 7 if http_referrer='abc.com' redirect to xyz.com/abc I looked at Redirect, http ...
1
vote
0answers
1k views

How to set GET param to current Request?

I created a service and it works as well. A piece of my code from "event_subscriber": public function addRequestAddValue(GetResponseEvent $event) { $request = $event->getRequest(); $request-&...
1
vote
1answer
3k views

Guzzle httpClient Drupal Core throwing cURL error 28 Operation timed out

I have been loading the httpClient Core Service in a drupal 8 site. The service class works just fine when the request doesn't take too long from the API. It seems that if the request takes any longer ...
1
vote
1answer
553 views

How to configure Apache/Varnish with http and https access (mixed content error)?

I have Drupal 7 installed on Ubuntu server with apache2 and varnish. I was asked to provide both http and https access to the site. To utilize Varnish I setup apache reverse proxy to redirect all ...
0
votes
0answers
96 views

Error 404 when trying to open link that exists (via click on link)

I have a strange bug in my site. Lets say that there is an external page with some links of my website. When clicking on a link i get a 404 error. The errors still occurs when trying to make some hard ...
2
votes
0answers
75 views

Getting An AJAX http error occured when updating modules

I recently staring getting a "An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://192.168.1.20/alan_page/authorize.php?batch=1&id=67&op=do ...
0
votes
1answer
5k views

How do I send a drupal_http_request() with GET method?

Following examples found here and in API, I tried 2 methods, both return a bad request status message. First method $data = 'name=value&name1=value1'; $options = array( 'method' => 'GET', ...
0
votes
1answer
399 views

drupal_http_request give 400 response code for working url

I have major problem while getting response. I am using drupal_http_request to get the response but I get 400 as response though url given is working... I tried Curl Http Request module to overrride ...
1
vote
1answer
509 views

drupal_http_request with proxy

I'm working on proxy based machine where I've configured my proxy settings at settings.php and its working fine. When I'm trying to access a URL the data is getting displayed perfectly, for instance, ...
1
vote
2answers
415 views

Error Adv CSS/JS Agg - Fast 404: HTTP Request [closed]

I have problems in my dashboard. Can you help me with the résoudres. I installed on my website the following modules : - fast 404 - Advanced CSS/JS Aggregation - HTTP Parallel Request & Threading ...
0
votes
1answer
336 views

Drupal status reports HTTP request status Fails on XAMPP

I have XAMPP 1.7.7 installed on Windows 7. My Drupal 7 website is configured using the following virtual server definition in the httpd-vhost.conf file. <VirtualHost *:80> DocumentRoot "C:\www\...
0
votes
0answers
16 views

How to investigate drupal_http_request replying 'connection timeout'? [duplicate]

Suddenly, my drupal 7 website showed some problem: not able to connect facebook, not able to send mail, not able to contact captcha server. Investigating, i found out that drupal_http_request is ...
0
votes
1answer
58 views

Google Analytics Reports with Background Process module (non-blocking http request)

Using Google Analytics Reports module latest version 7.x-3.0-beta2. I wanted to make this module to make requests in non-blocking fashion. Standard drupal makes it blocking fashion, which slows things ...
0
votes
1answer
138 views

How do I get request parameters when using fragment AND query with drupal_goto

I was successful in using fragment with drupal_goto, but when I use it AND query, I am not able to get the request parameters using $_GET from the query. I can see the request parameters in the URL,...
3
votes
1answer
333 views

drupal_http_request returning Invalid JSON primitive:

I am developing a module for Drupal 7 that has t make a call to a remote API. I am using drupal_http_build_query and drupal_http_request and finally drupal_json_decode to decode the output. My code ...
2
votes
1answer
1k views

How to solve the huge HTTPRL error that fills down all of Cron \ Status report?

Background For some time now, and only in some occasions, when I run CRON (Status report), I see a huge error (About 170 rows) at the HTTPRL section (related to the HTTP Parallel Request & ...
0
votes
1answer
310 views

problem with drupal_http_build_query output

am using drupal_http_build_query and have part of my code as follows: $or = db_or(); $or->condition('cid',$fField1); $or->condition('cid',$fField2); $or->condition('cid',$fField3); $or->...
1
vote
2answers
64 views

Can't install modules in a sub site — Seeing Ajax error

Background I have a Drupal 7.38 folder subsite (i.e yoursitesname.com/test). The site was installed with softaculous, and has only few core modules enabled. When I come to install the last version of ...
2
votes
1answer
948 views

Font Awesome not working when using HTTP

We have 2 subdomains for a website in order to test our development before moving to production. This is our structure: subdomainA.mysite.com subdomainB.mysite.com mysite.com When I enter to ...
0
votes
0answers
140 views

drupal_http_request not responding with redirect_url

I have a form like this: <FORM METHOD="POST" ACTION="https://some.url/with/data.asp" id=form1 name=form1> <INPUT type="hidden" NAME="name1" value="value1"> <INPUT type="hidden" ...
1
vote
0answers
556 views

Response object for Drupal HTTP Request

We are using the drupal_http_request function to send some data to salesforce. We've been told that one of the fields is being cut off and that they are receiving incomplete data. When I examine the ...
1
vote
1answer
517 views

Parameters in the HTTP request

I am trying to render a block depending on the parameter(entity) present in the requested page. Suppose if I am on a url like this: http://localhost/drupal8/user/1 then a block with label user is ...
1
vote
0answers
36 views

Question on Drupal and HTTP requests

I am using the drupal_http_request method and It seems to work well. When I use it, I send by POST from site A, a return URL (which would be site C) to site B that I am directing drupal to go to. So ...
2
votes
2answers
360 views

Avoiding PHP timeout when geocoding many addresses - preferred method?

I have a script that's taking in a ton of address data from a CSV, converting it to JSON, and along the way it hits the Google Maps API to get the latitude and longitude of each address. It then ...
1
vote
2answers
695 views

drupal_http_request times out on Google Maps geocoding URL

When I navigate to http://maps.google.com/maps/api/geocode/json?address=1200+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false (the Google Maps Geocoding API test address) in my browser (Chrome)...
1
vote
2answers
223 views

xmlrpc() error: (-1001) unable to parse URL during Drush command

I have an odd error coming from Drush when I perform module updates and other commands (it's most consistently comes from module updates). Near the end of the command execution this message pops up: ...
1
vote
2answers
699 views

Running asynchronous PHP code

I have Drupal server with a REST API using services and rest_server (that's just background, I don't THINK that applies to this problem at all.) I'd like particular API calls to only report back that ...
2
votes
2answers
1k views

how to make fewer http requests

I'm use YSlow to optimize my web pages it says: This page has 34 external Javascript scripts. Try combining them into one. This page has 5 external stylesheets. Try combining them into one. but all I ...
3
votes
1answer
4k views

How to fix SalesForce authentication errors on localhost?

I am fairly new to developing with Drupal, and new to this forum, so any help would be greatly appreciated. While trying to authorize SalesForce with a local install I get the following two errors ...
0
votes
1answer
706 views

SSL errors on Heroku (Mixed contents)

I have an app via Drupal 7 on Heroku. You know, myapp.herokuapp.com is default with SSL. But when I try https://myapp.herokuapp.com get many errors in console like this: Mixed Content: The page at ...
0
votes
1answer
592 views

Dealing with compressed JSON string from external API

I'm trying to call the Stack Exchange API but it sends compressed JSON strings and I can't uncompress it. $request = drupal_http_request('https://api.stackexchange.com/2.2/users?order=desc&sort=...
0
votes
1answer
1k views

Can't get data from drupal_http_request result

I'm requesting a zip file from a remote location, and I'm getting some strange affects here. Here is a snippet: $result = drupal_http_request($serviceUrl, $options); $file = $result->data; ...
1
vote
1answer
21k views

Using PHP cURL to send http get request

I am able to do the HTTP GET request using cURL in my custom function, my code below works fine for me, but is there Drupal way to do this? function some_page_callback() { $url = 'https://api....
4
votes
2answers
1k views

drupal_http_request and stream_socket_client

The D7 core function drupal_http_request uses the stream_socket_client() php function. For many serious web hosters, sockets and stream_sockets functions are a security bad practice and most of them ...
5
votes
2answers
16k views

How to use drupal_http_request for send data?

I need some help in sending data in an array (POST) to a webservice (REST). I need some examples in how to use the function drupal_http_request(). Now, I'm using cURL with PHP but I need to replace ...
6
votes
3answers
8k views

How to get remote webpage content with drupal http request?

Would love to see some examples on getting remote webpage content with drupal http request. I have plenty of examples easily with Google with curl, but yet to find one with this drupal function. Also,...
3
votes
1answer
2k views

How to post xml data in drupal_http_request? I have curl code of it

This is following curl code $ch = curl_init(); //initiate the curl session curl_setopt($ch, CURLOPT_URL, $url); //set to url to post to curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // ...
0
votes
1answer
2k views

Problem with cURL

I've run into a strange issue. I have a few simple lines CURL code for calling an api service. This code runs perfectly fine when running outisde of Drupal (in php file in browser and cli), but when ...