ostinelli / misultin

Misultin (pronounced mee-sool-téen) is an Erlang library for building fast lightweight HTTP(S) servers, which also supports websockets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to handle HTTP Redirect in misultin?

barakath opened this issue · comments

Hi,

I am trying to redirect the request to a new destination URL. But it is not working.

I am using

[302,"http://github.com"]

can anyone please help me with this issue

I would be surprised if that did work. :)

http://en.wikipedia.org/wiki/HTTP_302

you need to add the Location header to your response. Something like:

Req:respond(302, [{'Location', "http://github.com"}], "").

r.

Thanks. It works.

added a shortcut 309df57