A
A
Anton B2015-07-01 16:36:47
Regular Expressions
Anton B, 2015-07-01 16:36:47

Can I use the same resource address for private and non-private data?

Good afternoon.
It's about the RESTful API.
There is some document /doc/1000.
For the owner of the document, I can give out all the information on it.
For no owner, only metadata.
According to RESTful API principles, can I use one address for this? Or when I request my document, use /mydoc/1000, not mine - /doc/1000?
And in general, what about Best Practices? How about just recommendations based on someone else's experience, but do it as it suits me? Or "should"?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AngReload, 2018-10-17
@gh0st_d0g

I'll try to guess[0-9]+(?= )

A
Alexey Ukolov, 2015-07-01
@bigton

According to the principles of REST, there should be one url - the entity is the same, only the available fields differ.
Well, as for best practices , their full name is best practices for a majority of typical situations , hence the conclusion - there is no silver bullet, you should always think with your own head. If the tool interferes, you need to change the tool or modify it for the task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question