dimanche 24 mai 2020

How to sent GET request with some parameters?

I am new in the web dev. And have some questions. I hope someone can help me.

when I send a get request from an external device to my django server I do it like that:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)             

s.connect(("127.0.0.1" , 8000))    
s.sendall(b'GET / \n\n')
s.recv(100)
s.close

How can I see an address of a machine which sends a GET request to my web server (everything in the local network)? How can I send some data back to the same machine after receiving the GET request?

I also would like to be able to send a get request with some message what the device needs so the view in django can proccess it. How can I from the GET request with a additional message?

I use django, server and external devices are connected to the same network

thank you in advance,




Aucun commentaire:

Enregistrer un commentaire