JsonAPI: call to OPTIONS needed every single time?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rowild

JsonAPI: call to OPTIONS needed every single time?

Post by rowild » 10 Jan 2023, 15:45

I am confused: The JSONAPI documentation and its jquery code examples imply that on each and every call to a resource, OPTIONS must first be called. Is my assumption correct or false?

If I was to create a Vue or React app, I would use axios on initial call and save the resources to a local variable or a pinia variable. That way the OPTIONS request only has to be executed once. Am I totally wrong with that?

Also, the jquery examples seem a bit out of date. Are there any plans to update them? Maybe axios examples?

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: JsonAPI: call to OPTIONS needed every single time?

Post by aimeos » 12 Jan 2023, 09:46

In a PWA built with VueJS or ReactJS, you need to call the OPTIONS URL only once. The resources doesn't change.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rowild

Re: JsonAPI: call to OPTIONS needed every single time?

Post by rowild » 13 Jan 2023, 10:54

Thanks for clarifying that for me! Much appreciated! :-)

Post Reply