Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

how to pass header file in postAsync/post method of woocommerce-api in ionic 3 ??? I am facing CORS problem

This is my .htaccess file

RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [L,R=204]

Header always set Access-Control-Allow-Origin: "*"

Handling Options for the CORS

Add custom headers

Header set X-Content-Type-Options "nosniff" Header set X-XSS-Protection "1; mode=block"

Always set these headers for CORS.

Header always set Access-Control-Max-Age 1728000
Header always set Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT" Header always set Access-Control-Allow-Credentials true

but I got this error when use post method in ionic

Access to fetch at 'http://example.com/wp-json/wc/v3/customers?oauth_consumer_key=ck_5e2a116d993199af4526b813be9a83789cb125a6&oauth_nonce=6Es2SEfficl6agyUsiti29P1WCp4IwCx&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1544024742&oauth_version=1.0&oauth_signature=cyPovkKFinJz9iWNyGLZyzmqgfyEw0Z4ldpQ3PT%2B7w0%3D' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Comments