Problem 176 Say 100 - error No token found

Back to Problem Solutions forum

Dead Forest Foundation     2020-01-29 11:20:55
User avatar

Hi! I have a problems with this task. I use Java. When I send token - always I have the same request: "error: No token found"

I tried some various strings:

1aHN2KFKWtFCBe3CBuOzNTkx - error: No token found

token: 1aHN2KFKWtFCBe3CBuOzNTkx - error: No token found

token : 1aHN2KFKWtFCBe3CBuOzNTkx - error: No token found

So I tried several different input, but result the same.

What could be the mistake?

Quandray     2020-01-29 15:16:43
User avatar

Try with the string "token=whatever"

Rodion (admin)     2020-01-29 15:53:53
User avatar

Hi!

I think Quandray may be correct! Let me elaborate this.

Please check what Content-Type header you are sending. Instructions probably don't mention this (which should be fixed), but after some colleagues requests server now allows both text/plain (which is described in instruction, I believe) and also application/x-www-form-urlencoded. So if you send data in one format, but headers are set for another (e.g. by default), body is not properly parsed and fields are not found.

Sorry for this confusion - I hope I'll update instruction soon :)

Dead Forest Foundation     2020-01-29 18:21:58
User avatar

Okay. I tried already "token=whatever". The answer was: "Bad token"

I read the forum in search of a similar problem and found this option sending.

I think that I must to change type of content from String to Object.

Yours tasks are very interesting! I hope to solve at least 120 :)

Quandray     2020-01-29 20:46:13
User avatar

"Bad token" is much better than "No token found". Make sure you are changing "whatever" to your correct token.

Dead Forest Foundation     2020-01-30 07:25:55
User avatar

Thank you, Quandray! My request was like "token = JZRpZiAwFqVoRd0jMeir0TE4" - with 2 spaces before and after "=".

And now server does'nt answer me for next send:

request: token=JZRpZiAwFqVoRd0jMeir0TE4

answer: secret: 26

request: token=JZRpZiAwFqVoRd0jMeir0TE4&answer=74

answer: null

Dead Forest Foundation     2020-01-30 08:18:18
User avatar

Ok. I did it :)

For ALL users: Don't use " " (spaces) at the text of send.

Good luck!

Please login and solve 5 problems to be able to post at forum