README.asciidoc 770 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. = Basic authorization example using REST
  2. To try this example, you need GNU `make` and `git` in your PATH.
  3. To build and run the example, use the following command:
  4. [source,bash]
  5. $ make run
  6. Then point your browser to http://localhost:8080
  7. == Example output
  8. Request with no authentication:
  9. [source,bash]
  10. ----
  11. $ curl -i http://localhost:8080
  12. HTTP/1.1 401 Unauthorized
  13. connection: keep-alive
  14. server: Cowboy
  15. date: Sun, 20 Jan 2013 14:10:27 GMT
  16. content-length: 0
  17. www-authenticate: Basic realm="cowboy"
  18. ----
  19. Request with authentication:
  20. [source,bash]
  21. ----
  22. $ curl -i -u "Alladin:open sesame" http://localhost:8080
  23. HTTP/1.1 200 OK
  24. connection: keep-alive
  25. server: Cowboy
  26. date: Sun, 20 Jan 2013 14:11:12 GMT
  27. content-length: 16
  28. content-type: text/plain
  29. Hello, Alladin!
  30. ----