JornWildt / Mason

Documentation and examples for the Mason media type
MIT License
114 stars 6 forks source link

Resolving relative URLs #12

Closed JornWildt closed 9 years ago

JornWildt commented 9 years ago

How should a client resolve relative URLs in links and actions?

xogeny commented 9 years ago

The client should absolutely resolve relative URLs and absolute path URLs. I'm always surprised that this is not considered a best practice in APIs. There is a very good reason to have relative URLs and absolute path URLs and there are RFCs that define how they should be resolved. So there is no ambiguity except to specify a base URL. I would say relative to the requested resource. Although it would be nice to have some kind of meta data (as with HTML) to specify/override this.

JornWildt commented 9 years ago

See https://groups.google.com/forum/#!topic/hal-discuss/t1xld7fsYyM for a discussion in the HAL forum.