# Http Output 307 not being redirected

**URL:** <https://discuss.elastic.co/t/http-output-307-not-being-redirected/98493>\
**Category:** Logstash\
**Created:** [August 27, 2017, 10:30pm UTC](https://discuss.elastic.co/t/http-output-307-not-being-redirected/98493 "2017-08-27T22:30:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![insanityisnice](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@insanityisnice](https://discuss.elastic.co/u/insanityisnice)\
**Post date:** [August 27, 2017, 10:30pm UTC](https://discuss.elastic.co/t/http-output-307-not-being-redirected/98493/1 "2017-08-27T22:30:13Z")

</div>

I'm using an http output plugin to push events to EventStore. I am unable to get a successful POST and get an failure do to a 307 http status code. I've found several postings indicating that the http output plugin should be following the redirect and I have set the follow\_redirects = true. Any help understanding why this is not working would be helpful. The experiment can be found here [https://github.com/Insanityisnice/logstash-rabbit-to-eventstore](https://github.com/Insanityisnice/logstash-rabbit-to-eventstore). I'm using docker to host everything, instructions are in the [readme.md](http://readme.md)

The config file:  
input {  
rabbitmq {  
host =\> ["${RABBITMQ\_HOSTNAME}"]  
exchange =\> "test"  
exchange\_type =\> "topic"  
key =\> "test.#"  
metadata\_enabled =\> true  
}  
}

filter {  
}

output {  
stdout {  
codec =\> rubydebug  
}  
http {  
url =\> "http://${EVENTSTORE\_HOSTNAME}:${EVENTSTORE\_PORT}/streams/test"  
http\_method =\> "post"  
content\_type =\> "application/json"  
follow\_redirects =\> true  
headers =\> { "ES-EventType" =\> "Test.Created" }  
format =\> "message"  
message =\> "{'data':'a'}"  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 24, 2017, 10:30pm UTC](https://discuss.elastic.co/t/http-output-307-not-being-redirected/98493/2 "2017-09-24T22:30:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![rclarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rclarke/32/68604_2.png) [@rclarke](https://discuss.elastic.co/u/rclarke)\
**Post date:** [October 28, 2021, 7:03am UTC](https://discuss.elastic.co/t/http-output-307-not-being-redirected/98493/3 "2021-10-28T07:03:16Z")

</div>

The http library used is very conservative when it comes to status code handling. According to the RFC only `HEAD` and `GET` requests should be automatically redirected. Others like POST need user interaction (e.g. a browser dialog window).

The HTTP client does allow for having a custom redirect strategy to override this behaviour and even provides a more Lax strategy..aptly named [LaxRedirectStrategy](https://hc.apache.org/httpcomponents-client-4.5.x/current/httpclient/apidocs/org/apache/http/impl/client/LaxRedirectStrategy.html). Even this strategy won't redirect PUT requests, only HEAD/GET/DELETE/POST.

So at the moment there is no workaround other than using a `GET` request instead of a POST against the endpoint.
