I like to make a POST request to add an entity. I was able to do it in Postman. Now I am trying to do the same in VS Studio, but I am getting the error "The website encountered an unexpected error. Please try again later.".
I created the route in the module's routing.yml that points to a method of the Controller for an HTTP POST request.
In Postman, I was able to make a POST request as follows and was able to add the entity just fine.
Hi, I've created a report that displays all the file entites that can be found in all the media revisions that aren't the latest revision on my site. This has taken the form of two different view display executions, which are compared and processed ultimately leading to a final result set and that is rendered to my custom route by a third view that adds back pagination and some extra fields I want to include after all the calculations are done. All this takes place in a controller in my custom module.
I would like to implement 'http_client_middleware' on Drupal 10 in order to use the cookie to authorize against the API available over HTTPS. For that I need to:
Perform a GET request to login to the API and get the cookie
Use the cookie in following requests to authenticate with the API
I have working code implemented with the controller and now I would like to use it properly with 'http_client_middleware'. I have found a working example in:
I'm getting this error constantly and can't quite figure out what's wrong!
TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in strpos() (line 126 of core/lib/Drupal/Core/Extension/Dependency.php).
When a user navigates to /how I like to check if the user is logged in before displaying the content. I like to define _user_is_logged_in: 'TRUE' access requirement in the routing.yml file to check if the current user is logged in. But I am getting an error when clearing the cache.