Re: 400 bad request POSTing to Tomcat 7.0.42

2015-03-03 Thread Brett Ryan
ng(output.toByteArray()), ContentType.TEXT_XML); > 6 httppost.setEntity(entity); > 7 HttpResponse response = httpclient.execute(httppost); > > That's it. Added line 3 and line 4 replaced line 5. > >> >> On Tue, Mar 3, 2015 at 2:36 PM, Brett R

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-03-03 Thread Brett Ryan
> What confused me, is that I thought that tomcat should honor the encoding set > inside xml, while it just use content-type encoding or its default one > instead. Thats the correct behaviour. Your servlet container may choose to inspect the POST data but there is no requirement for it to, tha

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-03-02 Thread Brett Ryan
Hah. If it wasn't for that greek letter we wouldn't have been able to help you optimise your code, and the bug could have come up at a far more dire time in production. Sent from my iPhone > On 3 Mar 2015, at 03:27, Alessandro Manzoni > wrote: > > Il 02.03.2015 17.18,

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-03-02 Thread Brett Ryan
ski ha scritto: >> On Thu, 2015-02-26 at 13:28 +0100, Alessandro Manzoni wrote: >>> Thank you Oleg, >>> Il 26.02.2015 09.52, Oleg Kalnichevski ha scritto: >>>> On Thu, 2015-02-26 at 19:04 +1100, Brett Ryan wrote: >>>>>> Since I produce th

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-02-26 Thread Brett Ryan
I thought Oleg pointed this out already. If you build up a byte array for your request that byte array must fully occupy local memory, streaming this will both send data to the host as its constructed directly from the marshaller which is not only more efficient but will rule out any issue resu

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-02-26 Thread Brett Ryan
> On Thu, 2015-02-26 at 19:04 +1100, Brett Ryan wrote: >>> Since I produce the xml in memory, that's the way Marshal.marshal method >>> works, I could use the ByteArrayEntity using the byte[] from the >>> ByteArrayOutputStream supplied to marshal. >>

Re: 400 bad request POSTing to Tomcat 7.0.42

2015-02-26 Thread Brett Ryan
> Since I produce the xml in memory, that's the way Marshal.marshal method > works, I could use the ByteArrayEntity using the byte[] from the > ByteArrayOutputStream supplied to marshal. Could you not do something like PipedOutputStream out = new PipedOutputStream(); InputStream instr = new

Re: Support for http 2.0

2015-02-24 Thread Brett Ryan
Tony, HTTP/2 is 1.1 backwards compatible. If the client doesn't understand HTTP/2 then it will not elect HTTP/2 features. From my understanding performance gains are only going to be noticed by the new push mechanism that allows the server serve up parts of the content that the server thinks th

Re: how to disable cookie in HttpComponents Client?

2014-07-18 Thread Brett Ryan
Put it back in the jar? ;) Sent from my iPad > On 18 Jul 2014, at 7:41 pm, Li Li wrote: > > I don't want to keep cookie. > > - > To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org > For additional commands, e-m

Re: Using basic auth produces warnings about NTLM and NEGOTIATE errors.

2014-02-11 Thread Brett Ryan
Any other way to prevent it? I've also tried setting the proxyPreferredAuthSchemes property with no change. On 12 February 2014 02:44, Oleg Kalnichevski wrote: > On Wed, 2014-02-12 at 02:21 +1100, Brett Ryan wrote: > > Thanks Oleg, I've added this to the client, yet I a

Re: Using basic auth produces warnings about NTLM and NEGOTIATE errors.

2014-02-11 Thread Brett Ryan
r(credsProvider) .setDefaultAuthSchemeRegistry(authProviders) .setDefaultRequestConfig(rc) .setTargetAuthenticationStrategy(TargetAuthenticationStrategy.INSTANCE) .build(); On 12 February 2014 00:58, Oleg Kalnichevski wrote: > On Tue, 2014-02-11 at 14:20 +1100, Brett

Using basic auth produces warnings about NTLM and NEGOTIATE errors.

2014-02-10 Thread Brett Ryan
If a server supports NTLM and Kerberos authentication, but when setting up the client I only provide basic credentials I get a log for each of the NTLM and NEGOTIATE authentication schemes. Taking the example from : https://hc.apache.org/httpcomponents-client-4.3.x/httpclient/examples/org/apach