What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi herd… I’m trying to access the Glue Api from a parallel PHP application running in a separate Do
Hi herd…
I’m trying to access the Glue Api from a parallel PHP application running in a separate Docker instance, but it looks like Glue won’t accept the connection. I’m using Symfony’s HttpClient:
Fatal error: Uncaught Symfony\Component\HttpClient\Exception\ClientException: HTTP/1.1 404 Not Found returned for "<http://glue.pricecoshop.local/catalog-search?q=Cabbage>". in /var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php:174 Stack trace: #0 /var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php(48): Symfony\Component\HttpClient\Response\CurlResponse->checkStatusCode() #1 /var/www/html/vendor/symfony/http-client/Response/CurlResponse.php(247): Symfony\Component\HttpClient\Response\CurlResponse->doGetContent(true) #2 /var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php(83): Symfony\Component\HttpClient\Response\CurlResponse->getContent(true) ...
When I access the same endpoint via Postman it works fine.
When I simply type the endpoint URL into the browser, it works fine.
Also when I run the PHP script from the CLI it works too…
But it errors only when I try to access via the docker PHP application.
I’ve tried doing a simple CURL request from the application and this doesn’t work either.
My Spryker config is:
$config[GlueApplicationConstants::GLUE_APPLICATION_CORS_ALLOW_ORIGIN] = '*';
so it’s not a CORS thing…
Any help would be much appreciated!
Comments
-
I would check if the accept header is the same as in Postman. Postman adds the basic headers, like accept with
*
if they are not present.If you do an GET request try if it works in the browser, if so missing accept header is very likely your problem.
0 -
I think you’re right but I’m playing around with headers and getting 404's every time.
0 -
I’ll keep trying! 🙂
0 -
Oh no…! 🙀
I just realised…! I’m trying to access localhost on a different machine (technically) … since the 2 docker containers are separate!!!
I can’t believe i missed that!!!
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random