Comments (16)
I forked your sandbox and tested with my demo site. It returned no problem so it looks like you have not enabled CORS with CoCart. This can be done via the filter cocart_disable_all_cors
which is in the documentation. Or you can install the CORS plugin if you don't know PHP.
from cocart-js-lib.
The information provided here is very vague @sifulbd
Are you not able to fetch any headers or just X-CoCart-API
header?
from cocart-js-lib.
You should be able to get the data object which also passes the responses headers in a separate object so you can do response.data for the data or response.headers to view all the headers.
from cocart-js-lib.
I tried in all ways. I can fetch hearder. I am not able to fetch just X-CoCart-API
header.
You can see my response here: https://prnt.sc/117320v
from cocart-js-lib.
You will need to set the axiosConfig
option and tell it to set withCredentials
as true
. This should return all headers.
from cocart-js-lib.
Thank you for you text.
I tried with axiosConfig
but it seems the same result.
The out put is same : https://prnt.sc/117ij0a
from cocart-js-lib.
That is odd. The header is exposed so it should be returning.
from cocart-js-lib.
This article may help.
from cocart-js-lib.
If you were only not getting X-CoCart-API
header then I could look into it more but your not getting any other headers that should return by default.
from cocart-js-lib.
@sifulbd What version of CoCart are you using?
from cocart-js-lib.
Hi,
sorry for the delayed response.
I am getting the other headers except X-CoCart-API
.
I am using cocart/cocart-rest-api: ^1.0.1
version.
from cocart-js-lib.
I have created a code sandbox. I hope you can check it live: codesandbox link
from cocart-js-lib.
Hi,
sorry for the delayed response.
I am getting the other headers exceptX-CoCart-API
.
I am usingcocart/cocart-rest-api: ^1.0.1
version.
I was referring to the version of the CoCart plugin not the JS wrapper.
from cocart-js-lib.
Hi,
sorry for the delayed response.
I am getting the other headers exceptX-CoCart-API
.
I am usingcocart/cocart-rest-api: ^1.0.1
version.I was referring to the version of the CoCart plugin not the JS wrapper.
Version 2.9.1
from cocart-js-lib.
I don't know if it will help but would you mind updating to v2.9.2 as it is a hotfix. It might correct the header returning.
from cocart-js-lib.
no luck
from cocart-js-lib.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocart-js-lib.