doc.go 748 B

12345678910111213141516171819202122
  1. /*
  2. The Kurz Web API exposes these routes:
  3. - GET "/<short>" : resolve a short URL
  4. - Handler: HandleGetShort()
  5. - Success: 307 to matching target URL
  6. - Short not yet defined: 404 no matching target
  7. - Client request incorrect: 400
  8. - Server failure: 50*
  9. - POST "/" with <target>: create a short URL from a target URL
  10. - Handler: HandlePostTarget()
  11. - Success: 201 with <new short>
  12. - Already existing short: 409 with <existing short>
  13. - Target blocked for permission reasons: 403
  14. - Target legally censored: 451
  15. - Server failure: 50*
  16. Code 451 MAY be replaced by 403, for example when legal censorship includes a
  17. gag order, super-injunction (UK), National security letter (US) or similar
  18. mechanisms.
  19. */
  20. package api