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..
Hello guys how do I use ajax provider molecule to make a POST request with data in the body ?
Comments
-
Hello Ahmad!
Change themethod
attribute toPOST
in theinclude
For example:{% include molecule('ajax-provider') with { attributes: { method: 'POST', url: 'Your URL', }, } only %}
0 -
nice but what if I want to send dat in the body ?
0 -
so this will send a post request to the given url β¦ but where do I define the data for that post?
0 -
By default, the
ajax-provider
molecule can adddata
for the POST requests only with thefetch
method.0 -
are you saying that I cannot send data with post in ajax provider?
0 -
If using only
include
the molecule in TWIG, unfortunately not.0 -
ah ok
0 -
thank you mate π
0 -
one more question in the same topic
0 -
if the molecule is included and the ajax request does not appear in the browser console
0 -
what could be the problem?
0 -
Do you see the component in HTML debugger with correct attributes?
0 -
yes
0 -
Do you try to send this request by a trigger or by on load a page?
0 -
on page load
0 -
Did you change the
fetch-on-load
attribute ontrue
because itβsfalse
by default?0 -
so now it actually works
0 -
but there is something wierd
0 -
the request happens twice
0 -
one of them gets canceled
0 -
the second succeeds
0 -
any idea?
0 -
Check duplication of the component in HTML
0 -
there is not duplication !
0 -
actually another widget I am using .. just works out of the box with out specifying this fetch on load attribute
0 -
Thanks a lot @UQRP02SP2
0 -
π
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 74 Spryker News
- 911 Developer Corner
- 771 Spryker Development
- 87 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 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
- 69 Spryker Safari Questions
- 50 Random