Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it bad practice to put a period in a URI path?

Tags:

rest

uri

I am designing a REST API for a web application. I want to clearly version the API, so that the interface can be changed in the future without breaking existing services. So in my v1.0 API, I want to clearly identify it as the v1.0 API, leaving me the freedom to release a future v1.1 version with breaking changes.

My question is, would a period in the path component of a URI be bad practice?

eg. Is there any good reason not to use http://example.com/myapi/v1.0/services as a URI to my service?

like image 692
saille Avatar asked Apr 20 '10 21:04

saille


2 Answers

Putting a period in the URI is perfectly fine. Putting a version number in an URI is definitely not a best practice.

Here are my reasons why and here is an good article on the subject by someone much smarter than me.

like image 193
Darrel Miller Avatar answered Sep 23 '22 00:09

Darrel Miller


It is perfectly acceptable to use a period in a URI path. It is also valid as per RFC 3986 section 2.3.

like image 23
Daniel Vassallo Avatar answered Sep 25 '22 00:09

Daniel Vassallo