README.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. = Compressed response example
  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. Without compression:
  9. [source,bash]
  10. ----
  11. $ curl -i http://localhost:8080
  12. HTTP/1.1 200 OK
  13. connection: keep-alive
  14. server: Cowboy
  15. date: Mon, 07 Jan 2013 18:42:29 GMT
  16. content-length: 909
  17. A cowboy is an animal herder who tends cattle on ranches in North America,
  18. traditionally on horseback, and often performs a multitude of other ranch-
  19. related tasks. The historic American cowboy of the late 19th century arose
  20. from the vaquero traditions of northern Mexico and became a figure of special
  21. significance and legend. A subtype, called a wrangler, specifically tends the
  22. horses used to work cattle. In addition to ranch work, some cowboys work for
  23. or participate in rodeos. Cowgirls, first defined as such in the late 19th
  24. century, had a less-well documented historical role, but in the modern world
  25. have established the ability to work at virtually identical tasks and obtained
  26. considerable respect for their achievements. There are also cattle handlers
  27. in many other parts of the world, particularly South America and Australia,
  28. who perform work similar to the cowboy in their respective nations.
  29. ----
  30. With compression:
  31. [source,bash]
  32. ----
  33. $ curl -i --compressed http://localhost:8080
  34. HTTP/1.1 200 OK
  35. connection: keep-alive
  36. server: Cowboy
  37. date: Mon, 07 Jan 2013 18:42:30 GMT
  38. content-encoding: gzip
  39. content-length: 510
  40. A cowboy is an animal herder who tends cattle on ranches in North America,
  41. traditionally on horseback, and often performs a multitude of other ranch-
  42. related tasks. The historic American cowboy of the late 19th century arose
  43. from the vaquero traditions of northern Mexico and became a figure of special
  44. significance and legend. A subtype, called a wrangler, specifically tends the
  45. horses used to work cattle. In addition to ranch work, some cowboys work for
  46. or participate in rodeos. Cowgirls, first defined as such in the late 19th
  47. century, had a less-well documented historical role, but in the modern world
  48. have established the ability to work at virtually identical tasks and obtained
  49. considerable respect for their achievements. There are also cattle handlers
  50. in many other parts of the world, particularly South America and Australia,
  51. who perform work similar to the cowboy in their respective nations.
  52. ----