0

I'm learning python these days, and I have a rather basic question.

There's a remote server where a webserver is listening in on incoming traffic. If I enter a uri like the following in my browser, it performs certain processing on some files for me:

//223.58.1.10:8000/processVideo?container=videos&video=0eb8c45a-3238-4e2b-a302-b89f97ef0554.mp4

My rather basic question is: how can I achieve sending the above dynamic parameters (i.e. container = container_name and video = video_name) to 223.58.1.10:8000/processVideo via a python script?

I've seen ways to ping an IP, but my requirements are more than that. Guidance from experts will be very helpful. Thanks!

Community
  • 1
  • 1
Sophia111
  • 167
  • 2
  • 4
  • 13

1 Answers1

0
import requests
requests.get("http://223.58.1.10:8000/processVideo",data={"video":"123asd","container":"videos"})

I guess ... its not really clear what you are asking ...

Im sure you could do the same with just urllib and/or urllib2

import urllib
some_url = "http://223.58.1.10:8000/processVideo?video=%s&container=%s"%(video_name,container_name)# you should probably use urllib urllencode here ...

urllib.urlopen(some_url).read()
Joran Beasley
  • 110,522
  • 12
  • 160
  • 179
  • Thanks for getting me started Joran. I'll check this out! Any comment on which of the two approaches is faster/more secure? – Sophia111 Aug 30 '16 at 23:02