Skip to content
Advertisement

How to get json text by request with header details?

I would like to go to page https://losoviny.iamroot.eu/part_one and write json text from there. End at first I must login in https://losoviny.iamroot.eu/part_one_login and use details in header.

But if If I run code I see:

raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Do you know how to rewrite it? (Header data are correct)

Thank you

JavaScript

Advertisement

Answer

First you need to get the token from https://losoviny.iamroot.eu/part_one_login in order to test the API use postman. Your initial response is not a header element. It is a form, use below code to get the token.

JavaScript

After this I have no idea to pass the token header as per below code. Use header parameters when consuming the part_one endpoint. For header use Bearer format to build the Authorization header parameter.

JavaScript

As a practice use postman like tool to navigate an API. cheers!!!

Advertisement