Reputation: 703
I have methods in my API that have so be signed with hash of request parameters. Let's say I have three params in my request: 'first', 'second' and 'variable', which is set from environment variable. I need to add fourth parameter 'hash', which is equal to MD5([first][second][variable]):
test_var equals to 'test_variable'
To do this I calculate MD5 with Request Parsed Body params, which are read from current request. I get warnings that these params cannot be used because of self-dependency, and that request has an empty body, but MD5 is actually calculated correctly: MD5(firstParamsecondParamtest_variable) = 09f8669986f4152487da543e12e1e393
But, when I send this request hash value changes somehow, and is no longer correct:
first=firstParam&second=secondParam&variable=test_variable&hash=d3a0cc12d51633f07820b9d5ff167126
What's wrong?
Upvotes: 1
Views: 872
Reputation: 3481
It has been fixed in newer versions of Paw. You can simply do like suggested in the question. Right-click and pick Request > Request Parsed Body.
Add all the references you need, and you'll have the wanted hash:
You now have the MD5 of the three first params concatenated (no error reported).
Upvotes: 2