Дефис, подчеркивание или camelCase как разделитель слов в URI?
Я разрабатываю API-интерфейс на основе HTTP для приложения в интрасети. Я понимаю, что это довольно маленькая проблема в общей схеме вещей, но:should I use hyphens, underscores, or camelCase to delimit words in the URIs?
Вот мои первые мысли:
camelCase
possible issues if server is case-insensitive seems to have fairly widespread use in query string keys (http://api.example.com?searchQuery=...), but not in other URI partsHyphen
more aesthetically pleasing than the other alternatives seems to be widely used in the path portion of the URI never seen hyphenated query string key in the wild possibly better for SEO (this may be a myth)Underscore
potentially easier for programming languages to handle several popular APIs (Facebook, Netflix, StackExchange, etc.) are using underscores in all parts of the URI.Я склоняюсь к подчеркиванию для всего. Тот факт, что большинство крупных игроков используют их, является убедительным (см.https://stackoverflow.com/a/608458/360570).