extended-salmon
extended-salmon•2y ago

I am getting 301 status using refine-simple-rest although there is not any error on postman.

I am using refine-simple-rest as my data provider to connect with the django rest API but I get back response with 301 although there is not any problem with postman. If I use the same url from postman I get the repose back as normal but on refine app I always get response back with 301 status.
No description
5 Replies
extended-salmon
extended-salmon•2y ago
Here is the screenshot of my status code with request url.
Omer
Omer•2y ago
Hey @dipbazz 👋 , Could there be a http/https difference? 👀 Or maybe a trailing slash is required? http://API_URL/path/
extended-salmon
extended-salmon•2y ago
In my guess actually the problem is my refine-simple-rest is sending request to http://localhost:8000/voters and django server will try to convert the url into http://localhost:8000/voters/ Yes trailing slash is the issue but how can i give a trailing slash in my refine resource urls? The trailing slash is automatically appended at last and I get the response back when using postman. So how can I achieve the same using refine?
Omer
Omer•2y ago
You can do this with axios interceptors for example, https://refine.dev/docs/api-reference/core/providers/auth-provider/#setting-authorization-credentials You can add trailing slash before the request is sent 🚀
extended-salmon
extended-salmon•2y ago
Okay Thank you @Omer