Hi Community!
I’d like to request your help on something I’m facing while testing HTTP GET requests on any DocType API endpoint (e.g. /api/resource/Account) with Postman. Beforehand, I make sure to authenticate via /api/method/login and to get a session id, which works fine.
The first time I try I usually get 200 Ok, but if I try to exact same request a second time, I always get 404 with the main page in the body. The only way to succeed again with 200 is to login again and get a new session id.
How can I reuse the same request so that I don’t need to login every time I hit one of these endpoints?
Thank you in advance for any light you can shed on this!
For more info, these are headers from my request/responses (just hidding tokens):
==== First time (200):
---- Request ----
Authorization: token ************************************
User-Agent: PostmanRuntime/7.24.1
Accept: /
Postman-Token: a795dc49-c41d-4ebd-b762-7368f3ccf3fb
Host: localhost:8000
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: system_user=yes; user_image=; full_name=Administrator; user_id=Administrator; sid=3d9b714f2c0bc7a14b6c4fdfe87a1784083d45db8578f39a302bde0f
---- Response ----
Content-Type: application/json
Content-Length: 824
Set-Cookie: sid=3d9b714f2c0bc7a14b6c4fdfe87a1784083d45db8578f39a302bde0f; Expires=Tue, 19-May-2020 22:20:43 GMT; Path=/
Set-Cookie: system_user=yes; Path=/
Set-Cookie: full_name=Administrator; Path=/
Set-Cookie: user_id=Administrator; Path=/
Set-Cookie: user_image=; Path=/
Server: Werkzeug/0.16.1 Python/3.6.9
Date: Sat, 16 May 2020 22:20:43 GMT
===== Second time (404)
---- Request ----
Authorization: token ************************************
User-Agent: PostmanRuntime/7.24.1
Accept: /
Host: localhost:8000
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: system_user=yes; user_image=; full_name=Administrator; user_id=Administrator; sid=3d9b714f2c0bc7a14b6c4fdfe87a1784083d45db8578f39a302bde0f
---- Response ----
Content-Type: text/html; charset=utf-8
Content-Length: 6078
X-Page-Name: message
X-From-Cache: False
Server: Werkzeug/0.16.1 Python/3.6.9
Date: Sat, 16 May 2020 22:43:12 GMT