You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by John-Paul Delaney <jp...@artprocess.com> on 2007/03/23 11:08:20 UTC
Authenticate and send data in same request?
Hello List...
Apologies if this is a dumb question: Is it possible to authenticate and send
payload data in the same connection?
I need to make a soap connection to a windows server that requires that I
authenticate each time I send a soap request. I'm told the authentication and
request should take place in the same connection.
I've tried the default httpclient authentication for digest and it works
beautifully - however the request and response handle only the authentication -
is it possible to do both authentication and send data in the same request?
Many thanks
/j-p.
---------------------------------------------------------------------------
Open Invitation for Contemporary Visual Artists. http://www.artprocess.com
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: Authenticate and send data in same request?
Posted by Roland Weber <RO...@de.ibm.com>.
Hello John-Paul,
those are just examples. Examples are meant to be simple,
so they use GET requests if there is no need for a POST.
If you have to send a POST request instead, then just do it.
And I mean a single POST request here, not two of them.
hope that helps,
Roland
Re: Authenticate and send data in same request?
Posted by John-Paul Delaney <jp...@artprocess.com>.
Hello Roland... I've just noticed the postSoap file in the code examples. I
would like to try to do a combination of this and the AlternateAuthentication
example (to handle DIGEST authentication).
However one does an executeMethod(httpget), and the other an
executeMethod(post). With reference to the expect-continue handshake you
mentioned, could I first send a get, followed by a post? Or should I try
sending two posts (as the SOAP payload with be sent as a post)?
Many thanks again for your help, and for this great software.
Regards
/j-p.
Quoting Roland Weber <RO...@de.ibm.com>:
> Hello John-Paul,
>
> > Apologies if this is a dumb question: Is it possible to authenticate and
> send
> > payload data in the same connection?
>
> It depends on the type of authentication. For BASIC auth, you can enable
> preemptive authentication.
>
> > I need to make a soap connection to a windows server that requires that
> I
> > authenticate each time I send a soap request. I'm told the
> authentication and
> > request should take place in the same connection.
> > I've tried the default httpclient authentication for digest and it works
> > beautifully - however the request and response handle only the
> > authentication -
> > is it possible to do both authentication and send data in the same
> request?
>
> For DIGEST authentication, the client needs a challenge from the server.
> You can enable the expect-continue handshake. If the server is
> co-operative,
> the request will first be sent without payload and obtain the challenge,
> then the request is repeated with payload and authentication.
>
> hope that helps,
> Roland
>
>
---------------------------------------------------------------------------
Open Invitation for Contemporary Visual Artists. http://www.artprocess.com
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: Authenticate and send data in same request?
Posted by Roland Weber <RO...@de.ibm.com>.
Hello John-Paul,
> Apologies if this is a dumb question: Is it possible to authenticate and
send
> payload data in the same connection?
It depends on the type of authentication. For BASIC auth, you can enable
preemptive authentication.
> I need to make a soap connection to a windows server that requires that
I
> authenticate each time I send a soap request. I'm told the
authentication and
> request should take place in the same connection.
> I've tried the default httpclient authentication for digest and it works
> beautifully - however the request and response handle only the
> authentication -
> is it possible to do both authentication and send data in the same
request?
For DIGEST authentication, the client needs a challenge from the server.
You can enable the expect-continue handshake. If the server is
co-operative,
the request will first be sent without payload and obtain the challenge,
then the request is repeated with payload and authentication.
hope that helps,
Roland