Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: 4ndre4 <626401fd-4bc7-4f8f-b641-563ae0f72920@626401fd-4bc7-4f8f-b641-563ae0f72920.invalid> Newsgroups: comp.lang.java.programmer Subject: Re: Rest parameter without value Date: Fri, 14 Oct 2016 21:16:57 +0100 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 14 Oct 2016 20:16:38 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="1abf80d047cf401ea9626e7850440608"; logging-data="5348"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cYMiQk2od1+ZVpUAnFTZa" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 In-Reply-To: Cancel-Lock: sha1:nyw0OgYSDN7w8ZbSLYFH4ZQoiOc= Xref: csiph.com comp.lang.java.programmer:35759 On 14/10/2016 13:28, Jukka Lahtinen wrote: [...] > I have been working with java, but REST is new to me. [...] > I have used an url like this: > http://machine/path/v3.0/keyvalue > (where "keyvalue" is the variable path parameter and the url is > otherwise constant) It does not really make sense. REST is based on the concept of "resource". Typically, you have something like: http://somehost/somepath/users (a GET returns the list of users, a POST create a new user) http://somehost/somepath/user/user-id (a GET returns the user, a PUT updates the user) etc.. Another important concept is HATEOAS. I suggest that you read up about correct REST API construction. There's plenty of resources around. For example, the following links: http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#restful http://restful-api-design.readthedocs.io/en/latest/resources.html -- 4ndre4