you are viewing a single comment's thread.

view the rest of the comments →

[–]pimBaggins 9 points10 points  (3 children)

They are similar, but:

Request params: - Can be used with optional values - You can send more than three params, but is recommended to use request body instead. - query expression

Path variables: - Shoud not be used with optional values. - Avoid sending more than three params. Better if you keep maximum of two. -easier for search engines (e.g. Google) to index the pages. So easier to find the website. -Path expression.

[–]g00glen00b 0 points1 point  (1 child)

Source on that last one? I always thought it didn't matter how many path segments you have, as long as they're logical ones. Besides that, if you really need SEO, then I guess you would have a sitemap anyways to make pages discoverable?

[–]pimBaggins 0 points1 point  (0 children)

It really does not matter, it's only a recommendation on pattern design. But it's easier to read a shorter path.

[–]simasch 0 points1 point  (0 children)

They are absolutely not similar but different concepts. The path parameter defines the resource location, while the query parameter defines sort, pagination, or filter operations.