Skip to content

Latest commit

 

History

History

echo-get

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

GET parameter echo example

To try this example, you need GNU make and git in your PATH.

If you don’t have HTTPie installed, use the appropriate cURL commands instead.

Building

To build the example, run the following command:

make

Starting

Release

To start the release in the foreground:

./_rel/echo-get-example/bin/echo-get-example console

Note: The previous command also starts an Erlang console.

LFE

To start the app and an LFE shell:

lfe -pa ebin -pa deps/*/ebin -s echo-get # make dev

Usage

Point your browser at http://localhost:8080/?echo=hello

You can replace the echo parameter with another to check that the handler is echoing it back properly.

Example output

http -v :8080 echo==saymyname
GET /?echo=saymyname HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8080
User-Agent: HTTPie/0.9.2
HTTP/1.1 200 OK
content-length: 9
content-type: text/plain; charset=utf-8
date: Mon, 21 Sep 2015 03:37:04 GMT
server: Cowboy
saymyname