You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2017/04/24 22:07:31 UTC

No HttpConnect class?

Hi,

I noticed a couple of "CONNECT" strings hard coded here and there and
wondered why we do not have an HttpConnect class (with a METHOD_NAME
static) like we have HttpGet, and so on.

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: No HttpConnect class?

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Apr 25, 2017 at 1:37 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Tue, 2017-04-25 at 01:27 -0700, Gary Gregory wrote:
> > On Tue, Apr 25, 2017 at 1:00 AM, Oleg Kalnichevski <ol...@apache.org>
> > wrote:
> >
> > > On Mon, 2017-04-24 at 15:07 -0700, Gary Gregory wrote:
> > > > Hi,
> > > >
> > > > I noticed a couple of "CONNECT" strings hard coded here and there
> > > > and
> > > > wondered why we do not have an HttpConnect class (with a
> > > > METHOD_NAME
> > > > static) like we have HttpGet, and so on.
> > > >
> > > > Gary
> > > >
> > >
> > > CONNECT is a special purpose method that is unlikely to be
> > > applicable
> > > to common scenarios. It is being used internally by HttpClient to
> > > establish multi-hop routes via a proxy or a chain of proxies. I see
> > > no
> > > good reason to have HttpConnect given it can be easily misused.
> > >
> >
> > OK, how about putting this in a Javadoc for a static definition of
> > the
> > "CONNECT" constant? I'm just trying to gather knowledge in
> > comments...
> >
>
> I added an enum with standard methods to HttpClient 5.0. It is still in
> my private branch on GitHub though. Please just bear with me a little
> longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
> out.
>

No rush on the 5.0a3 side as I am deep in 4.4.6 in my current project.

I hope to take the time to create a branch of my project on 5.0 once a3 is
out.

Gary


>
> Oleg
>
> > Gary
> >
> >
> > >
> > > Oleg
> > >
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: dev-help@hc.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: No HttpConnect class?

Posted by Julian Reschke <ju...@gmx.de>.
On 2017-04-25 22:24, Gary Gregory wrote:
> On Tue, Apr 25, 2017 at 8:02 AM, Julian Reschke <ju...@gmx.de>
> wrote:
>
>> On 2017-04-25 10:37, Oleg Kalnichevski wrote:
>>
>>> ...
>>> I added an enum with standard methods to HttpClient 5.0. It is still in
>>> my private branch on GitHub though. Please just bear with me a little
>>> longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
>>> out.
>>> ...
>>>
>>
>> FWIW, why have an enum for something that is extensible? Or, phrased
>> differently, what is your definition of "standard methods"?
>>
>
> These are standard:
> https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9

Nope.

See <https://www.iana.org/assignments/http-methods/http-methods.xhtml>.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Apr 25, 2017 at 8:02 AM, Julian Reschke <ju...@gmx.de>
wrote:

> On 2017-04-25 10:37, Oleg Kalnichevski wrote:
>
>> ...
>> I added an enum with standard methods to HttpClient 5.0. It is still in
>> my private branch on GitHub though. Please just bear with me a little
>> longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
>> out.
>> ...
>>
>
> FWIW, why have an enum for something that is extensible? Or, phrased
> differently, what is your definition of "standard methods"?
>

These are standard:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9

Gary


>
> Best regards, Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: No HttpConnect class?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2017-04-26 at 11:26 +0200, Julian Reschke wrote:
> On 2017-04-26 11:11, Oleg Kalnichevski wrote:
> > On Tue, 2017-04-25 at 17:02 +0200, Julian Reschke wrote:
> > > On 2017-04-25 10:37, Oleg Kalnichevski wrote:
> > > > ...
> > > > I added an enum with standard methods to HttpClient 5.0. It is
> > > > still in
> > > > my private branch on GitHub though. Please just bear with me a
> > > > little
> > > > longer. I'll commit that code to SVN as soon as HttpCore 5.0a3
> > > > goes
> > > > out.
> > > > ...
> > > 
> > > FWIW, why have an enum for something that is extensible?
> > 
> > Enums are extensible, are they not? Just not at runtime.
> 
> Not for the *users* of the project, right?
> 

Right. Why should it even be? Those are methods we, as a project,
provide as standard (common, most widely applicable, whatever, feel
free to propose a better term).


> > > Or, phrased
> > > differently, what is your definition of "standard methods"?
> > > 
> > 
> > Standard might well be not the best term. Please do feel free to
> > suggest a better one. By 'standard' methods I meant those specified
> > in
> > RFC 7231, section 4.3 + PATCH.
> 
> I fail to see how these are special. 

They are not.

Oleg


> The HTTP spec is pretty clear that�
> methods are an extension point, and that the source of truth is the
> IANA�
> registry, not a specific RFC. If you want to draw a distinction, you�
> could check the standards level of the RFC defining the method (but�
> it'll turn out that pretty all of them currently are at "proposed"
> state�
> due to the weird way the IETF defines it's standards).
> 
> Best regards, Julian
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Julian Reschke <ju...@gmx.de>.
On 2017-04-26 11:11, Oleg Kalnichevski wrote:
> On Tue, 2017-04-25 at 17:02 +0200, Julian Reschke wrote:
>> On 2017-04-25 10:37, Oleg Kalnichevski wrote:
>>> ...
>>> I added an enum with standard methods to HttpClient 5.0. It is
>>> still in
>>> my private branch on GitHub though. Please just bear with me a
>>> little
>>> longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
>>> out.
>>> ...
>>
>> FWIW, why have an enum for something that is extensible?
>
> Enums are extensible, are they not? Just not at runtime.

Not for the *users* of the project, right?

>> Or, phrased
>> differently, what is your definition of "standard methods"?
>>
>
> Standard might well be not the best term. Please do feel free to
> suggest a better one. By 'standard' methods I meant those specified in
> RFC 7231, section 4.3 + PATCH.

I fail to see how these are special. The HTTP spec is pretty clear that 
methods are an extension point, and that the source of truth is the IANA 
registry, not a specific RFC. If you want to draw a distinction, you 
could check the standards level of the RFC defining the method (but 
it'll turn out that pretty all of them currently are at "proposed" state 
due to the weird way the IETF defines it's standards).

Best regards, Julian




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2017-04-25 at 17:02 +0200, Julian Reschke wrote:
> On 2017-04-25 10:37, Oleg Kalnichevski wrote:
> > ...
> > I added an enum with standard methods to HttpClient 5.0. It is
> > still in
> > my private branch on GitHub though. Please just bear with me a
> > little
> > longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
> > out.
> > ...
> 
> FWIW, why have an enum for something that is extensible? 

Enums are extensible, are they not? Just not at runtime.


> Or, phrased�
> differently, what is your definition of "standard methods"?
> 

Standard might well be not the best term. Please do feel free to
suggest a better one. By 'standard' methods I meant those specified in
RFC 7231, section 4.3 + PATCH.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Julian Reschke <ju...@gmx.de>.
On 2017-04-25 10:37, Oleg Kalnichevski wrote:
> ...
> I added an enum with standard methods to HttpClient 5.0. It is still in
> my private branch on GitHub though. Please just bear with me a little
> longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
> out.
> ...

FWIW, why have an enum for something that is extensible? Or, phrased 
differently, what is your definition of "standard methods"?

Best regards, Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2017-04-25 at 01:27 -0700, Gary Gregory wrote:
> On Tue, Apr 25, 2017 at 1:00 AM, Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Mon, 2017-04-24 at 15:07 -0700, Gary Gregory wrote:
> > > Hi,
> > > 
> > > I noticed a couple of "CONNECT" strings hard coded here and there
> > > and
> > > wondered why we do not have an HttpConnect class (with a
> > > METHOD_NAME
> > > static) like we have HttpGet, and so on.
> > > 
> > > Gary
> > > 
> > 
> > CONNECT is a special purpose method that is unlikely to be
> > applicable
> > to common scenarios. It is being used internally by HttpClient to
> > establish multi-hop routes via a proxy or a chain of proxies. I see
> > no
> > good reason to have HttpConnect given it can be easily misused.
> > 
> 
> OK, how about putting this in a Javadoc for a static definition of
> the
> "CONNECT" constant? I'm just trying to gather knowledge in
> comments...
> 

I added an enum with standard methods to HttpClient 5.0. It is still in
my private branch on GitHub though. Please just bear with me a little
longer. I'll commit that code to SVN as soon as HttpCore 5.0a3 goes
out.

Oleg

> Gary
> 
> 
> > 
> > Oleg
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> > 
> > 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: No HttpConnect class?

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Apr 25, 2017 at 1:00 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Mon, 2017-04-24 at 15:07 -0700, Gary Gregory wrote:
> > Hi,
> >
> > I noticed a couple of "CONNECT" strings hard coded here and there and
> > wondered why we do not have an HttpConnect class (with a METHOD_NAME
> > static) like we have HttpGet, and so on.
> >
> > Gary
> >
>
> CONNECT is a special purpose method that is unlikely to be applicable
> to common scenarios. It is being used internally by HttpClient to
> establish multi-hop routes via a proxy or a chain of proxies. I see no
> good reason to have HttpConnect given it can be easily misused.
>

OK, how about putting this in a Javadoc for a static definition of the
"CONNECT" constant? I'm just trying to gather knowledge in comments...

Gary


>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>

<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: No HttpConnect class?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2017-04-24 at 15:07 -0700, Gary Gregory wrote:
> Hi,
> 
> I noticed a couple of "CONNECT" strings hard coded here and there and
> wondered why we do not have an HttpConnect class (with a METHOD_NAME
> static) like we have HttpGet, and so on.
> 
> Gary
> 

CONNECT is a special purpose method that is unlikely to be applicable
to common scenarios. It is being used internally by HttpClient to
establish multi-hop routes via a proxy or a chain of proxies. I see no
good reason to have HttpConnect given it can be easily misused.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org