doc.go 838 B

123456789101112131415161718192021222324
  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. - Client request incorrect: 400
  7. - Short not yet defined: 404 no matching target
  8. - Target blocked for permission reasons: 403
  9. - Target legally censored: 451
  10. - Server failure: 50*
  11. - POST "/" with <target>: create a short URL from a target URL
  12. - Handler: HandlePostTarget()
  13. - Success: 201 with <new short>
  14. - Already existing short: 409 with <existing short>
  15. - Target blocked for permission reasons: 403
  16. - Target legally censored: 451
  17. - Server failure: 50*
  18. Code 451 MAY be replaced by 403, for example when legal censorship includes a
  19. gag order, super-injunction (UK), National security letter (US) or similar
  20. mechanisms.
  21. */
  22. package api