Tag Info

New answers tagged

2

Since you are updating just part of the resource you should consider using PATCH HTTP method. Request format depends on your other API calls. Prefer consistency. If you use JSON elsewhere use JSON. Same goes for XML or whatever language you use. I suggest using JSON, but I don't know how complex your API is. Do, I'd do this: PATCH person/1 Content-Type: ...


1

Wikipedia has a suitable definition for Middleware. It says: Middleware is the software that connects software components or enterprise applications. [It] is the software layer that lies between the operating system and the applications on each side of a distributed computer network. Typically, it supports complex, distributed business software ...


1

This is the expected behavior in case of a DELETE request. So much so that in rails if you generate a resource or scaffold (using rails generate), this is what is generated. All 2xx statuses are "success" statuses. So if you are actually not sending any content, it is best to mention it with a no_content So rest assured that what you are doing is in fact ...


5

Why are RFC's hard to read? The purpose of RFC's is to ensure interoperability on the internet by precisely specifying protocols. For this purpose precision and unambiguity is much more important than easy readability for laymen. The target audience for RFC's are systems developers implementing network stacks, not the common developer who just writes import ...


0

There is the question whether 202 is the right result for what you are doing, and the other question is how the client processes it. If a client receives a 202, chances are that it doesn't handle it properly (many clients will only recognise 200 as success, everything else is bad). But what if the client recognises it: 202 means the server promised to do ...


4

There are two similar responses that should be considered depending on what the expected response should be. The 202 Accepted response is a "yep, got that" response. The resource is created and the server will get around to doing something with that. The request has been accepted for processing, but the processing has not been completed. The request ...


6

202 Accepted The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. Seems like a good fit to me. That the resource gets created immediately does not actually complete the processing in your case.


0

I presume you are talking about guesstimating urls, that is, replacing my "/4/" with a "/42/" to see if someone else has something under http://www.mypage.com/questions/42/answers". As far as I know the first and foremost best practice is to implement proper security everywhere, so that a user who does not have permission to see something will never be able ...


1

If your primary concern is preventing user X from accessing a resource A that's unique to user Y, then per-user ids don't solve this. What you really need is authentication, i.e. a secure way of verifying that a request for resource A is actually being made by user Y, not just some other user pretending to by Y. If you don't have authentication, then ...


0

The Same-Origin Policy Same Origin Policy Part 2: Limited Write More is explained on this issue, I hope you'll get answer to your questions.



Top 50 recent answers are included