bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Syntax for RESTful scripting options


From: Darshit Shah
Subject: Re: [Bug-wget] Syntax for RESTful scripting options
Date: Fri, 8 Mar 2013 23:48:23 +0530

Okay gathering inputs from all the replies above., I think the best way to
move forward would be to implement a --method=<GET|POST|PUT|DELETE>
followed by --post-data or --post-file in case of POST and --put-data
--put-file in case of the PUT option.
In other cases wget expects the URL next.
The GET option is included only for completeness.

Please do let me know if I'm missing something.

Also, as Tim pointed out, wget does not test whether the file exists. I'll
patch that too.

On Fri, Mar 8, 2013 at 5:12 AM, Hrvoje Niksic <address@hidden> wrote:

> Tim Ruehsen <address@hidden> writes:
>
> > BTW:
> > How can Wget create a POST without any data (without Content-Type and
> Content-
> > Length) ? Curl can...
>
> If by "without any data" you mean with empty POST data, use
> `--post-data=""'.  But that will send 0 Content-Length and the usual
> Content-Type.  As always, you can customize both headers using the
> `--header' option, but I don't think you can remove them entirely.
>
> Maybe the `--header' syntax could be extended so that `--header=NAME'
> (note lack of trailing colon -- currently illegal) could be used to
> delete the generated header from the HTTP request.
>
> > resulting request:
> > POST /xxx HTTP/1.1
> > User-Agent: Wget/1.14 (linux-gnu)
> > Accept: */*
> > Host: localhost:8000
> > Connection: Keep-Alive
> > Content-Type: application/x-www-form-urlencoded
> > Content-Length: 0
> >
> >
> > OT (I just see it): Why does Wget send 'Connection: Keep-Alive' here ?
> > It is not needed and causes unecessary impact on the server...
>
> Because Wget tries to reuse the same connection for multiple requests.
> For example, the server can respond with a redirection, which would
> require a new request, best carried out on the same connection.  (Plus,
> the code at that point doesn't have the information that it is the last
> request that will be run.)
>
>


-- 
Thanking You,
Darshit Shah
Research Lead, Code Innovation
Kill Code Phobia.
B.E.(Hons.) Mechanical Engineering, '14. BITS-Pilani


reply via email to

[Prev in Thread] Current Thread [Next in Thread]