In which cases Idempotent PUT would be useful in REST?
Ok. I have read at several places that using the same PUT URL several times should have the same effect. PUTting data to Api/Student/1234 should either create or update the same student with id 1234.
Now every Url will have a payload of the actual student data that needs to be added or updated in the database. Why not the ID be part of the payload? I can simply PUT data to Api/Student with the payload containing the ID.
You would say that the Url is not idempotent. My question is how will I benefit by making a PUT url idempotent? I understand that GET must be idempotent. But why would PUT need to be idempotent because the client is the one putting the data. Calling the same URL Api/Student with payload containing the same student Id will have the same effect each time. So the purpose is solved right?
I have a Tree structure like data from the database, there will be Single parent and to its multiple levels of childrens, I am able to create the db table and store according to that structure, Now I
Are there any cases where an application running on linux, which has not blocked signal SIGKILL, will not get killed on firing SIGKILL signal ?
I am new to REST and I understand that the idea of resource is central to a RESTful service. Let's say I have created a RESTful service which allows users to create/read/update/delete some objects in
Are there any cases in which Rails overwrites controller instance variables on a render :partial call performed in a template? For example, let's say we have: controller def my_action @widget = Widget
I'm building a Django project that needs a good search functionality Which of the search engines out of these would be good to use with django haystack solr elasticsearch Xapian One other advice I n
I'm using django-rest-framework (latest) for REST API, and implemented few test cases in django using built in test client. following django test case was working fine with django version < 1.5 sel
I'm seeing a good bit of hand-waving on the subject of how to update only part of a resource (eg. status indicator) using REST. The options seem to be: Complain that HTTP doesn't have a PATCH or MODI
Shouldn't PUT be used to Create and POST used to Update since PUT is idempotent. That way multiple PUTs for the same Order will place only one Order?
How do I enable PUT on my IIS 6 for wcf .net 4.0 SVCless rest services. My Services are at the root of the website. Please help! TIA EDIT: I get 501 - Not Implemented when the service is hosted at
I have an django app, a model which stores data entered via a web interface by a user. I need to consume an third party REST api when viewing / saving a model instance. I know how to do this but, wha
Can you point out a scenario in which Python's bytearray is useful? Is it simply a non-unicode string that supports list methods which can be easily achieved anyway with str objects? I understand some
I have a set of web methods that I am planning to convert to REST on top of MVC or WCF. But I am little confused after reading few questions and answer on similar topic. ** My app is .NET 4, C# with M
Been extensively testing the SharedPreferences framework. While most works as one would expect I run across some cases where I wonder what's the reasoning behind them. I give some tests all of which p
Do anyone here have any useful code which uses reduce() function of python? Is there any code other than the usual + and * that we see in the examples? Refer Fate of reduce() in Python 3000 by GvR
I have a person model with the fields first_name, last_name and email. I'd like to send these fields to a view that would check the DB for an existing instance. If there is one the ID will be returned
So I know that PUT is idempotent, whereas POST is not. Let's say I have an 'add to team' type method. If you're not already on the indicated team, you're added. If you are on the team already, then no
I am wondering where the best place to put XSS protection in our website. Our team is split up into a front end and back end teams and are using REST as an API between our two groups since we use diff
I am using the WCF REST template in VS 2010 to build RESTful web services for my app. I've completed all the GETs but am now trying to handle updates, and I keep getting 404 on the PUT even though it
It is possible, albeit counterproductive, to write a unit test which executes some code, and asserts truth. This is a deliberately extreme, and simplified example - I'm sure most people have come acro
I have tried to implement a REST WCF in order to explore difference between PUT and POST verb. I have uploded a file in a location using the service. The service implementation is as folowing: [Operat
I'm writing a RESTful service with Struts2 and the Struts2 REST plugin. Currently, my service is able to handle GET requests without issues, but I'm stuck trying to get it the update (PUT) request t
How can we make Pentaho retry rest requests on connection errors? We have a Pentaho BI system which, among numerous data sources, is querying a particular REST api for over 20k query variations each r
I was just wondering, why would somebody want to create multiple projects in one solution, if he could just as easily create a new solution for each project. What are the best practices/arguments in
Can anyone suggest me a helpful programming language which can be used to create a tool which will analyse the given C program and generate a txt report or html report containing information about the
I'm using jersey API for some REST web services with apache Tomcat. I need to pass more than one parameter to a method so I decided to use @QueryParam annotation like this : @GET @Path(/date) @Produ
I have two URL's which contain the parameter tour_date which I am trying to read out in PHP. Running $_REQUEST[tour_date] for the first URL: .php?tour_id=336&tour_date=11/06/2010 returns the v
OpenCL 2.0 introduced a new feature, pipes. When would this be useful? Are there types of applications where you would benefit from pipes? Are there hardware architectures which are more suitable?
I am new to symfony and my project is to build a complex web application in symfony. There will be many small features like pdf export, xls export, document upload which can be used in future projects
I realize that some of the classes that are not added to my shrinkWrap archive are used during running the arquillian test cases which cause problems. I have a boot function in my application config w
I see two possible implementations for a MAX macro in C. Which of these would be best? define MAX(X,Y) ((X) < (Y) ? : (Y) : (X)) define MAX(X,Y) 0.5*(X+Y+ABS(X-Y))
PowerShell 3.0 CTP1 introduces a new feature [ordered] which is somewhat a shortcut for OrderedDictionary. I cannot imagine practical use cases of it. Why is this feature really useful? Can somebody p
I'm sorry to put another REST Authenticate question on the website but I really need to get a complete answer. I have a REST API in which I try to log in a single page website (through jquery). I want
I want to design my rest endpoint with the appropriate method for the following scenario. There is a group. Each group has a status. The group can be activated or inactivated by the admin. Should i de
I saw that it adds events to an Observable. However, you would only add it if you would fire it at some point. So, if you add the firing of the event at some line in your code, it was useless to put i
I have looked at nearly every single WCF Rest PUT/POST issues on SO here and have still been unable to determine why I am unable to PUT or POST to my web service but am able to call a test GetTime met
I am in the process of putting the finishing touches to a very complex webapp which will go into beta shortly. My PHP coding style involves writing scores of small scritps that get reused in different
Is there anyway we can avoid running observable code in few cases? How i tried? The only way i found to avoid is by adding new properties to the view as flags which will if checked before running the
I have a DLL from which I need to P/Invoke the following C method: int DAOpen(HANDLE *hOpen, UNIT *flags, void *callback, char *userData) I've come up with the following C# signature: [DllImportAttri
I am trying to see how PendingIntents are useful. Can you provide examples of apps where PendingIntents are used? I am not looking for examples of code, but real life use cases where PendingIntents ar
I am in trouble. I have no idea how to solve the problem below. Could you give me some advice? Now I have an error message. RuntimeError at / Called id for nil, which would mistakenly be 4 -- if you r
In my symfony application I would like to create custom php class. And access that class via back end and front end. Can someone show me which folder should I put that class and how to access it? Tha
Why do we need HTTP GET, PUT, or DELETE to be idempotent if TCP/IP is a reliable protocol that will retry requests on our behalf?
I have the following code in which I'd like for only the first two cases to share a common property; however, I get the error id conflicts with the declaration at line 11 when I try to use this synt
I work with File.java class. Most of its methods can throw SecurityException. But I don't find any information about cases in which it throws. I look in android sources and find following: different
I used to work with another, more experienced programmer who would put almost ALL of the utility calls within a shell script in the following manner: FOO=`which foo` $FOO -bar After working with the
I've been digging around documentation for JIRA's latest REST API (6.0.1) to try and dig out information about a particular dashboard (I'm playing around with Dashing to create a widget displaying the
I'm using django-rest-framework and I need to map in the URL file two generic views with the same url (iḿ already using URLs but not Routes): I need to allow GET, PUT and DELETE verbs in just one url
I am having some UI problem that causes it to send 2 put requests one after the other at the same time. The problem is that the REST API, which does a PUT action compares an object from the database
To use an example, should it be $name == John Doe or $name === John Doe? I'd guess that equality comparisons would perform worse as they would do some kind of type casting. p.s. I know that the pe