Net:HTTP post question

Heya all,

I am using Net::HTTP to do post actions to a server, but I have to
include a file in the post action.

I found this:

http://www.realityforge.org/articles/2006/03/02/upload-a-file-via-post-with-net-http

Is that really the only way to add a file to a POST action using Net::HTTP?

What I want is the equiv of adding a file in a file select box in a
form using post.

Mikel

I just read that WWW::Mechanize has an interface for fileuploads, see
EXAMPLES.txt in the API doc:

http://mechanize.rubyforge.org/mechanize/

Martin

···

On Monday 12 May 2008 15:06:43 Mikel Lindsaar wrote:

Heya all,

I am using Net::HTTP to do post actions to a server, but I have to
include a file in the post action.

I found this:

http://www.realityforge.org/articles/2006/03/02/upload-a-file-via-post-with
-net-http

Is that really the only way to add a file to a POST action using Net::HTTP?

What I want is the equiv of adding a file in a file select box in a
form using post.

Mikel

Looks perfect, thanks :slight_smile:

Mikel

···

On 5/13/08, Martin Boese <boesemar@gmx.de> wrote:

I just read that WWW::Mechanize has an interface for fileuploads, see
EXAMPLES.txt in the API doc:

http://mechanize.rubyforge.org/mechanize/

Martin

On Monday 12 May 2008 15:06:43 Mikel Lindsaar wrote:
> Heya all,
>
> I am using Net::HTTP to do post actions to a server, but I have to
> include a file in the post action.
>
> I found this:
>
>
http://www.realityforge.org/articles/2006/03/02/upload-a-file-via-post-with
>-net-http
>
> Is that really the only way to add a file to a POST action using
Net::HTTP?
>
> What I want is the equiv of adding a file in a file select box in a
> form using post.
>
>
> Mikel