Re: [Tutor] Making http posts
by Kent Johnson other posts by this author
Nov 5 2009 4:35AM messages near this date
[Tutor] Making http posts
|
Re: [Tutor] Making http posts
On Thu, Nov 5, 2009 at 5:06 AM, Stephen Nelson-Smith <sanelson@[...].com> wrote:
> Hello,
>
> I want to make an HTTP POST which will require authentication.
What kind of authentication? Basic auth is easy to use from Python;
form-based auth is a bit tricker.
> This is because we are using a web tool without an API, and we want a
> programatic way of getting content into the tool. Â Tech support of the
> web tool have said we can just make a POST to the http endpoint.
>
> >From the below source, it looks like I just post some text to
> /project/4254/stories, with the ID of addStoryForm.
IIRC the form ID is not part of the post. The text has to be formatted
as name=value pairs.
> Is the best way to do this just a simple urllib script?
urllib2. See my writeup here:
http://personalpages.tds.net/~kent37/kk/00010.html
> What's the best way to find out from the browser exactly what is being
> posted when I use the web interface? Â Tcpdump? Â Or is the a better
> tool?
There are Firefox addons for this. It's been a while so I'm not sure
which ones but I think either Firebug or Tamper Data will do it.
Kent
_______________________________________________
Tutor maillist - Tutor@[...].org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thread:
Stephen Nelson-Smith
Kent Johnson
Rich Lovely
|