Akka Http Client - 302 Found no redirect

770 views
Skip to first unread message

Peter Neyens

unread,
Mar 5, 2015, 7:05:40 PM3/5/15
to akka...@googlegroups.com
Hello,

I'm trying to access an XML webservice with the akka http client, but always receive a 302 Found response.

The code I use to do a request :
  lazy val serviceConnection =
    Http().outgoingConnection("hostname-of-service", 80)

  def doRequest(request: HttpRequest): Future[HttpResponse] =
    Source.single(request).via(serviceConnection).runWith(Sink.head())

 
When I use
  val url = new java.net.URL("...")
  scala.xml.XML.load(url)

I do not receive the 302 Found response and receive the xml response.

I don't know if akka http client does not follow the redirect or if it is similar to this old spay issue.

Kind regards,
Peter

Patrik Nordwall

unread,
Mar 9, 2015, 6:19:18 AM3/9/15
to akka...@googlegroups.com
On Fri, Mar 6, 2015 at 1:05 AM, Peter Neyens <peter....@gmail.com> wrote:
Hello,

I'm trying to access an XML webservice with the akka http client, but always receive a 302 Found response.

The code I use to do a request :
  lazy val serviceConnection =
    Http().outgoingConnection("hostname-of-service", 80)

  def doRequest(request: HttpRequest): Future[HttpResponse] =
    Source.single(request).via(serviceConnection).runWith(Sink.head())

 
When I use
  val url = new java.net.URL("...")
  scala.xml.XML.load(url)

I do not receive the 302 Found response and receive the xml response.

I don't know if akka http client does not follow the redirect

I think that can be the case, see issue https://github.com/akka/akka/issues/15990

/Patrik
 
or if it is similar to this old spay issue.

Kind regards,
Peter

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

 Scala Days

Peter Neyens

unread,
Mar 9, 2015, 8:18:31 AM3/9/15
to akka...@googlegroups.com
Thank you for your reponse.
Good to know much more features for http client are being worked on : https://github.com/akka/akka/issues/16856

In the mean time I have resorted to Dispatch to access this webservice.

Peter

Op maandag 9 maart 2015 11:19:18 UTC+1 schreef Patrik Nordwall:
Reply all
Reply to author
Forward
0 new messages