I have a question regarding HTTP requests. I don't even know if this is possible, but was trying to figure a way out to implement this.
Check out this function in Python:
def send_this(url):
this_browser=mechanize.Browser()
this_browser.set_handle_robots(False)
this_browser.addheaders=[('User-agent','Chrome')]
test_output=this_browser.open(url).read().decode("UTF-8")
return test_output
So when I run this from my machine, quite obviously, the value is returned and written into the variable translated
.
What I'd like to know is, is there a way in which the request could be sent to the URL and the output (this_browser.open(url).read().decode("UTF-8")
), instead of begin written into this variable, is sent to another destination altogether without coming back to the place of origin?
This is a diagrammatic representation of what I want to achieve.
My Machine
and Another Server
are both under my control. The server to which the request is sent is not.
- First, is implementing this possible?
- Second, what implementations/technologies should I look into to implement this?