Possible to make http requests in the code?

Hi guys,
I’ve been trying to create http requests from the editor.
Latest example in python3

import urllib.parse
import urllib.request

url = 'http://www.someserver.com/cgi-bin/register.cgi'
values = {'name' : 'Michael Foord',
          'location' : 'Northampton',
          'language' : 'Python' }

data = urllib.parse.urlencode(values)
data = data.encode('ascii') # data should be bytes
req = urllib.request.Request(url, data)
with urllib.request.urlopen(req) as response:
   the_page = response.read()

But I have a feeling the codingame platform doesn’t support http requests…

ConnectionResetError: [Errno 104] Connection reset by peer
at socket.py. in readinto on line 375
at client.py. in _read_status on line 313
at client.py. in begin on line 351
at client.py. in getresponse on line 1172
at request.py. in do_open on line 1185
at request.py. in http_open on line 1210
at request.py. in _call_chain on line 441
at request.py. in _open on line 481
at request.py. in open on line 463
at request.py. in urlopen on line 161
at Answer.py. in <module> on line 15

Does anybody have experience in this? Doesn’t matter which programming language.

Hi!

Of course we don’t allow network requests from our servers.
We don’t want our servers to be used for a DDOS attack! This would also allow you to cheat.

Why do you want it?

Keep coding

thanks for the reply. Yeah ofc it makes sense :slight_smile: Was just hoping it might be possible. Not for blackhat shenanigans. But was entertaining the idea of having some sort of neuralnetwork and needed a way of storing the weights.

1 Like

CG makes it really hard to use NNs, as you’d need to hardcode the weights.

1 Like