Giter Club home page Giter Club logo

Comments (16)

seb86 avatar seb86 commented on June 10, 2024 1

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.

seb86 avatar seb86 commented on June 10, 2024

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.

seb86 avatar seb86 commented on June 10, 2024

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.

sifulbd avatar sifulbd commented on June 10, 2024

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.

seb86 avatar seb86 commented on June 10, 2024

You will need to set the axiosConfig option and tell it to set withCredentials as true. This should return all headers.

Options to config Axios.

from cocart-js-lib.

sifulbd avatar sifulbd commented on June 10, 2024

Thank you for you text.
I tried with axiosConfig but it seems the same result.

Screenshot_12

The out put is same : https://prnt.sc/117ij0a

from cocart-js-lib.

seb86 avatar seb86 commented on June 10, 2024

That is odd. The header is exposed so it should be returning.

from cocart-js-lib.

seb86 avatar seb86 commented on June 10, 2024

This article may help.

from cocart-js-lib.

seb86 avatar seb86 commented on June 10, 2024

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.

seb86 avatar seb86 commented on June 10, 2024

@sifulbd What version of CoCart are you using?

from cocart-js-lib.

sifulbd avatar sifulbd commented on June 10, 2024

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.

sifulbd avatar sifulbd commented on June 10, 2024

I have created a code sandbox. I hope you can check it live: codesandbox link

from cocart-js-lib.

seb86 avatar seb86 commented on June 10, 2024

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.

I was referring to the version of the CoCart plugin not the JS wrapper.

from cocart-js-lib.

sifulbd avatar sifulbd commented on June 10, 2024

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.

I was referring to the version of the CoCart plugin not the JS wrapper.

Version 2.9.1

from cocart-js-lib.

seb86 avatar seb86 commented on June 10, 2024

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.

sifulbd avatar sifulbd commented on June 10, 2024

no luck

from cocart-js-lib.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.