Skip to content

Caveat regarding trailing slash in Uliza API endpoints

Heikki Johannes Hildén edited this page Dec 7, 2017 · 4 revisions

As a consequence of Django's url normalization rules, the Uliza API requires a trailing slash at the end of all urls.

Correct

http://dev.uliza.fm/api/v1/participants/1/

Incorrect

http://dev.uliza.fm/api/v1/participants/1

A request to participants/1 returns the response code 301 MOVED PERMANENTLY with a Location header pointing to the correct url.

$ curl -v http://dev.uliza.fm/api/v1/participants/1
< HTTP/1.1 301 MOVED PERMANENTLY
< Server: nginx/1.4.6 (Ubuntu)
< Date: Thu, 07 Dec 2017 13:57:47 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Frame-Options: SAMEORIGIN
< Location: http://dev.uliza.fm/api/v1/participants/1/