Jack Hudgins
Jack Hudgins

Reputation: 93

POST request a string to HTTP Url

I have tried to come up with a solution and can't even get a base code worked out.

I just want a simple way to take a string, example: "http://192.168.0.1/mobile/code.fcgi?serverId=1"

and send that string to a target IP.

So take the string above and post it to 192.168.0.67.

Thanks, J

Upvotes: 0

Views: 71

Answers (1)

M. Shaw
M. Shaw

Reputation: 1742

import requests
r = requests.post('192.168.0.67', data={'url': 'http://192.168.0.1/mobile/code.fcgi?serverId=1'})

Upvotes: 1

Related Questions