Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
747 12
Hi,
I have access to an API towards my Solarsystem which im trying to setup.
To get to the actual data i need to first get a Token by providing username/pass which i then use to send together with the next request and this is where it stops.
I can do the same thing in Postman and it works.
The Token can look something like this:
eyJhbGciOiJIUzI1NiJ9.eyJyYW5kb21LZXkiOiIyMjRmZTVmNC1lOGE1LTQ5MmUtOTgxNC03ZTc1OTU1ZmI5ZDQifQ.3DgsI-vX-wZgy5X_dgqHswOwOCnw5QcYVWF0wHfJp58
When i print this out in a scene before using it i can see it always performs a line feed after the first '-' in the string.
When examine the string in notepad++ there is no \r or \n (CR|LF) but somehow, something is happening with the Token string and i suspect that this is the problem..
Im saving the Token as a global var and then use it in the header (xsrfToken):
options = {
headers = {["XSRF-TOKEN"] = tostring(xsrfToken), ['Content-Type'] = 'application/json'},
method = 'POST',
checkCertificate = false,
data = json.encode(pLoad)
},
Maybe someone has met the same problem?
BR
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.