Accessing REST WS Issue

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
olw
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: Fri Aug 11, 2017 8:51 am

Accessing REST WS Issue

Post by olw » Fri Sep 01, 2017 10:02 am

Hi, I have been trying to access the REST WS from React (using Javascript fetch library) and got this error message.

Code: Select all

Fetch API cannot load http://xxx.xxx.x.xxx:8080/OpenKM/services/rest/auth/login. Response for preflight has invalid HTTP status code 401
When i don't have cross-origin resource sharing enabled, this is the error I got:

Code: Select all

Fetch API cannot load http://xxx.xxx.x.xxx:8080/OpenKM/services/rest/auth/login. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 401. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
But when i tried sending the request from Postman, it does work.
Can anyone please help me solving this issue?

olw
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: Fri Aug 11, 2017 8:51 am

Re: Accessing REST WS Issue

Post by olw » Fri Sep 01, 2017 10:09 am

I have solved this issue by doing this:

viewtopic.php?f=6&t=20618

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest