Back to General discussions forum
After completing the first interactive problem (say-100),I went on to the second (nim-game) but the server will not recognize a fresh token. Here's the code in Python 3.7:
import requests
d='mB4k4LR67sABxrJ6FbjUdzY5'
response=requests.post('http://open-abbey.appspot.com/interactive/nim-game',data={'token':d})
print(response)
Output is: <Response [200]>
The expected response would be something like:
heaps: 2 3 4
It's working for me using C++ and curl. A HTTP 200 response is an "OK". Did you get anything after that?
Hello!
Thanks to Quandray for checking this! Well, since the server probably works, something is probably wrong with your code.
I am still poor at Python and don't remember exactly how we do it in python using requests
, but after this hint
I've looked at your code for Say-100
- and here is slight difference:
Instead of:
response=requests.post
print(response)
You wrote:
response=requests.post
print(response.text)
# ^^^^^
I guess the response is object and you need to take the field .text
?
Thank you, Rodion. You are correct. I must have been a little sloppy when copying my code.
print(response) returns only the status code
print(response.text) returns the status code and content
It's working for me now.