Questions tagged [http-request]

Use it for questions about HTTP requests, sending and receiving requests, status codes and more.

Filter by
Sorted by
Tagged with
1 vote
1 answer
144 views

RuntimeException when patch submission. Module Webform Rest

When i send a PATCH request to my site to /webform_rest/{webform_id}/submission/{sid}?_format=json with the body { "data":{ "sincronizado":1 } } or { "...
mcventur's user avatar
1 vote
1 answer
85 views

Decoupled Drupal - Security: files structure

I am running a Drupal 8.9.2 site as a content repository accessed via an Angular 8 app. So there is one administrator who uses the Drupal interface to write content / upload files eccc.... and ...
elenat82's user avatar
1 vote
0 answers
55 views

Decoupled Drupal - Security [closed]

I am running a Drupal 8.9.2 site as a content repository accessed via an Angular 8 app. So there is one administrator who uses the Drupal interface to write content / upload files eccc.... and ...
elenat82's user avatar
1 vote
0 answers
702 views

cant read current user in middleware

i am relatively new to drupal . thus i am trying to make an sso system work . i have this parent domain "domain.com" and the drupal site is running on sub.domain.com  . i can read the cookies and all ....
akramabdelrahman's user avatar
1 vote
1 answer
1k views

HTTP Client Manager $request->getStatusCode() == 200 return?

When I read this HTTP Client Manager docs on Drupal, I don't understand why it returns the $build when $request->getStatusCode() == 200, is that supposed to be not equal 200? I also copy and paste the ...
Jiang Zhan's user avatar
1 vote
1 answer
2k 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 ...
Wisamx's user avatar
  • 53
1 vote
1 answer
23 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 ...
xarzu's user avatar
  • 119
1 vote
0 answers
2k 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-&...
slivorezka's user avatar
1 vote
1 answer
983 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, ...
Rishi Kulshreshtha's user avatar
1 vote
0 answers
625 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 ...
user2441356's user avatar
1 vote
0 answers
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 ...
Will's user avatar
  • 33
1 vote
1 answer
109 views

Omega theme showing 404 on iPhone

I have a site on my local server which is served by Apache using virtual hosts. I am using an omega sub-theme. On the desktop everything works fine. I try to browse to the site via the iPhone by ...
Stephen Burke's user avatar
0 votes
1 answer
212 views

How to return Service Worker with custom HTTP header from custom module

I have a custom module providing a HTML5 Service Worker file under /modules/custom/my_blocks/assets/js/service-worker.js. Since the Service Worker is not located in the root of the Drupal server, I ...
david's user avatar
  • 184
0 votes
1 answer
1k views

How can I return a JSON response from an internal function ? (not the main callback)

I have a callback that is running for a specific post request. I am returning a certain JSON response at the end of it. What if I want to catch errors inside one of the functions that are ran in that ...
Yaron's user avatar
  • 263
0 votes
2 answers
1k views

HTTP error 500 when backup entire site

Using Backup and Migrate module on a D7 site separate backups (data / files) give no problem (backup to nodesquirrel AND download) but backup entire site (data + files) generates "http error 500" (...
MarkDQ's user avatar
  • 153
0 votes
1 answer
206 views

How to force a JS library to be loaded via HTTPS?

How can I force a js library to always load only via SSL? Specifically, I want to get Drupal to always load stripe.js with SSL, because stripe.js refuses to load over http (you get a 403 FORBIDDEN ...
Patrick Kenny's user avatar
0 votes
1 answer
1k views

How do I handle an incoming POST request in a module?

I am really new to Drupal but I have to do a project using it and I was just wondering how to handle an incoming POST request in a module: I am creating a module that will get incoming data from a ...
T Kharel's user avatar
0 votes
2 answers
3k views

How to get and apply current page query parameters from current AJAX request

I'm having a hard time figuring out how to do this. Essentially I have a table displaying users on a page. The table is paginated with the PagerExtender and sortable with the TableSortExtender. Each ...
joegl's user avatar
  • 175
0 votes
1 answer
3k views

Problem with SSL certificate [closed]

I just enable SSL certificate for my domain. I added that in my .htaccess file: RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^domainname\.com* RewriteRule ^(.*)$ https://www.domainname.com/$...
user avatar
0 votes
1 answer
282 views

Circular reference detected for service "http_kernel" with middleware having the correct number of arguments

I'm pretty confused by this. I am experimenting with using an HTTP middleware to try to send Google Analytics page views from the server instead of the client. However, after adding a basic middleware,...
Patrick Kenny's user avatar
0 votes
1 answer
142 views

Decoupled site as a presentation (display) layer for external microservices?

I understand that Drupal 9 out of box is very capable as a decoupled aka headless Drupal serves as a back-end for other apps (the core REST, JSONAPI capability). However, I am thinking about the ...
gilzero's user avatar
  • 6,037
0 votes
1 answer
340 views

Render sub arrays with http client manger API calls response

I am trying to consume PokeAPI using Drupal. For making API calls I am using HTTP Client Manager module. I am able to set up initial configuration and get the data when the response field is a string. ...
miststudent2011's user avatar
0 votes
1 answer
53 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 ...
Volker's user avatar
  • 1,360
0 votes
1 answer
73 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 ...
Paulius Pazdrazdys's user avatar
0 votes
2 answers
94 views

hook_menu_get_item_alter() needs to give a 404

How can I throw a 404 error from within hook_menu_get_item_alter()? If I call drupal_not_found() then it keeps calling itself, and I don't know an other way to do this.
Noë's user avatar
  • 103
0 votes
3 answers
841 views

custom block menu path returns json Ok, but a 404 status header

I created a custom path via hook_menu with a page callback to a function that prints json. It all works in the sense that requesting: http://cms.tripchi.com/tripchi/getme returns my JSON, but the ...
E.A.T's user avatar
  • 374
0 votes
1 answer
4k views

An AJAX HTTP error ocurred. HTTP Result Code: 500 (while trying to rebuild content access perms)

I have installed a module that ask me everytime to rebuild content Access Permissions, but every time I try to do it, it shows me an error I do not have idea why is it happening. Please help An AJAX ...
svelandiag's user avatar
0 votes
1 answer
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 ...
lordg's user avatar
  • 705
0 votes
0 answers
118 views

Using StreamedResponse for AJAX?

I am looking for a way with a Form API form in Drupal to have an #ajax event on a form field. When submitted, this calls a remote API. How can I stream the response out to the screen without the ...
Kevin's user avatar
  • 27.7k
0 votes
0 answers
59 views

Specific CORS on a custom form POST request

I'm on D 9.3.x I have a custom form, e.g. my_module.my_form: path: 'custom-form-end-point' defaults: _title: 'Custom Form' _form: 'Drupal\my_module\Form\MyFormController' requirements: ...
Giuseppe's user avatar
  • 907
0 votes
1 answer
330 views

How to POST file with JSON:API in /jsonapi/file/file?

I tried with POSTMAN to upload a file to my endpoint host/jsonapi/file/file, the POST method is available but when I try to upload something, drupal gives me a 415 unsupported media type error. I ...
JPcode's user avatar
  • 1
0 votes
0 answers
219 views

Troubleshooting Setting Cache Context to Session in Preprocess

My goal is to look for "webp" in the client HTTP_ACCEPT header in order to determine if I can serve WebP images. I chose this approach rather than using the WebP module because I thought it ...
user avatar
0 votes
1 answer
183 views

Get client credentials from Simple Oauth module

I am creating user authentification with Drupal 9 + NuxtJS. Using Simple Oauth module and create post requests to oauth/token with data const data = { grant_type: 'password', client_id: '', ...
Вадим Гаджимурадов's user avatar
0 votes
0 answers
52 views

Post Data to D7 from D9

How do I post data from Drupal 9 when a content is created, post data to Drupal 7 hosted in a different server to create node content. In Drupal7, I have enabled services module and created a resource ...
shablm's user avatar
  • 99
0 votes
0 answers
24 views

Delaying a Rules action until previous actions are complete

I'm making an HTTP request in an action which obviously takes some time. I want to use the response of that request in another action, but every time I get an error since the request hasn't completed ...
yuuuu's user avatar
  • 141
0 votes
1 answer
1k views

Cloudflare Clear Cache For One URL, Convert Curl Command to Drupal::httpClient() Or php

I am creating a custom module to clear caches on cloudflare for one url. The original curl command: curl -X POST "https://api.cloudflare.com/client/v4/zones/123456789/purge_cache" \ -H &...
Alaa Haddad's user avatar
0 votes
1 answer
483 views

Upload External File to Drupal File System

Situation I would like to be able to upload files programmatically from an external source to the drupal file system. I was thinking of making a RESTful API that allows me to save external files into ...
B. Cratty's user avatar
0 votes
0 answers
78 views

Why is the Downloading file size unknown despite Content-Length headers set with file size in bytes?

During Downloading files the size is unknown "0B" despite having set the "Content-Length" headers with the bytes (see $http_headers below) Content-Type (String, 15 characters ) application/zip ...
Markus's user avatar
  • 113
0 votes
0 answers
981 views

Guzzle POST HTTPS requests return 403 Forbidden only when called inside PHPUnit tests

On one side I have a remote Drupal 8 (8.8.1) served via HTTPS which has the following endpoint: MODULENAME.get_notify: path: 'MODULENAME/get-notify' defaults: _controller: '\Drupal\MODULENAME\...
Roger's user avatar
  • 218
0 votes
0 answers
322 views

How to Resolve CORB Issue using Drupal Docker Container

I'm running the latest version of the Drupal docker container. I'm trying to make a GET API call via Javascript and I'm receiving back CORB (cross-origin-read-blocking) errors in the Console when ...
jeffnaismith_design's user avatar
0 votes
0 answers
51 views

Help needed with ajax request from Jquery to callback function

I create the callback url 'swish_payment/request' in my hook_menu() function: function swish_payments_menu(){ $items['swish_payment/request'] = array( 'type' => MENU_CALLBACK, ...
TBJ's user avatar
  • 606
0 votes
1 answer
153 views

Securing Admin on separate port

I am attempting to secure the admin pages (/admin/*) and login page (/user/login) to port 8443. I have successfully done that with the following in apache 2.4: <VirtualHost _default_:443> ...
Taylor's Designs's user avatar
0 votes
1 answer
229 views

Get data from remote REST API (read only)

We use a remote service (not Drupal) to publish press releases and to show those releases in a remote newsroom. This remote service offers an API so we should be able to fetch and show the newsroom ...
TBJ's user avatar
  • 606
0 votes
1 answer
1k views

Removing specific HTTP response header

I am trying to remove specific HTTP response header from my site. The header looks like this: Link: <https://example.com>; rel="canonical",<https://example.com>; rel="shortlink" So far ...
Adam Šulc's user avatar
0 votes
1 answer
1k views

HttpFoundation Request POST parameters

From VueJS, I am sending a POST HTTP request to my Drupal 8 controller. Here is my Controller: <?php namespace Drupal\mymodule\Controller; use Drupal\Core\Controller\ControllerBase; use Symfony\...
MrUpsidown's user avatar
0 votes
0 answers
135 views

drupal_http_request as authenticated user during cron

I have a rule set up that runs during cron. Part of that rule is an action that is supposed to save a PDF (via Entity Print which only authenticated users can access) to my server. It works fine when ...
MrPeanut's user avatar
  • 383
0 votes
1 answer
32 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 ...
Udders's user avatar
  • 103
0 votes
1 answer
26 views

500 error on one page in entire site only showing error "You are here" instead of administration content

this error seems to only affect one page in on the website, and nowhere else. Here is what it looks like: The watchdog reports do not show the issue, and I believe it to be a permission error or ...
A.Lopez's user avatar
0 votes
2 answers
749 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 ...
Lars Hansen's user avatar
0 votes
1 answer
330 views

The web service endpoint returned a "HTTP/1.1 403 Forbidden" response

There are 12 or so similar questions but not drupal related. Here is my site on a digitalocean droplet: http://104.236.27.226/ It is apache2 on ubuntu16 php7. I am using: 000-default.conf: ...
Casey Carnnia's user avatar