Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 463671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:11:54+00:00 2026-05-12T23:11:54+00:00

The Objective : A script which cycles through a list of proxies and sends

  • 0

The Objective: A script which cycles through a list of proxies and sends a post request, containing a file to a PHP page on my server, which then calculates delivery time. It’s a pretty useless script, but I am using it to teach myself about urllib2.

The Problem: So far I have got multipart/form-data sending correctly using Poster, but I can’t get it to send through a proxy, let alone a cycling list of proxies. I have tried using an OpenerDirector with urllib2.ProxyHandler, but I believe Poster defines it’s own opener to perform it’s magic.

Below is the code to send a multipart/form-data request with poster.

import urllib2
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers

fields = {"type": "image",
          "fileup": open("/home/chaz/pictures/test.jpg", "rb")
         }

register_openers() #I believe this is the key
datagen, headers = multipart_encode(fields)
request = urllib2.Request("http://foo.net", datagen, headers)

lastResponse = urllib2.urlopen(request).read()

Any help would be much appreciated as I am stumped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:11:54+00:00Added an answer on May 12, 2026 at 11:11 pm

    you could add proxy installer like this, before requesting the page.

    from urllib2 import ProxyHandler,build_opener,install_opener
    
    PROXY="http://USERNAME:PASSWD@ADDRESS:PORT"
    
    opener = build_opener(ProxyHandler({"http" : PROXY}))
    
    install_opener(opener)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script file containing 1000 lines of data and some of the
My objective is to write a program which will call another executable on a
I have a WSDL script which has the following format <definitions name=ProcessData targetNamespace=urn:ProcessData> <message
I'm having some trouble devise a script which attempts a login to a billing
I would like to run a shell script, from a file or from an
I have the following php script that allows me perform some calls to other
Objective-C has no namespaces; it's much like C, everything is within one global namespace.
Objective: take a UIImage, crop out a square in the middle, change size of
Objective : Make a progress bar where users can check how much of a
The Objective Caml language will only produce stack traces if you ask for them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.