http-method

HTTP method to represent “fire and forget” actions in RESTful service

 ̄綄美尐妖づ 提交于 2019-12-10 04:35:50
问题 Thinking about REST, it's relatively easy to map HTTP methods to CRUD actions: POST for create, GET for read, etc. But what about "fire and forget" actions? What HTTP method would best represent a fire and forget action such as triggering a batch job (in which no response is sent back to the caller)? POST would spring to mind, but I think GET is also an appropriate method because 99% of the time you only supply a bunch of parameters to these types of actions. What do you think? 回答1: POST

Any method to get constant for HTTP GET, POST, PUT, DELETE? [duplicate]

放肆的年华 提交于 2019-12-06 17:02:34
问题 This question already has answers here : Where are the request method constants in the Servlet API? (6 answers) Closed 6 years ago . For example, HttpServletResponse has the HTTP status codes as constants like public static final int SC_OK = 200; public static final int SC_CREATED = 201; public static final int SC_BAD_REQUEST = 400; public static final int SC_UNAUTHORIZED = 401; public static final int SC_NOT_FOUND = 404; Is there any such constants defined for HTTP methods like GET , POST ,

HTTP method to represent “fire and forget” actions in RESTful service

天涯浪子 提交于 2019-12-05 06:14:22
Thinking about REST, it's relatively easy to map HTTP methods to CRUD actions: POST for create, GET for read, etc. But what about "fire and forget" actions? What HTTP method would best represent a fire and forget action such as triggering a batch job (in which no response is sent back to the caller)? POST would spring to mind, but I think GET is also an appropriate method because 99% of the time you only supply a bunch of parameters to these types of actions. What do you think? POST would spring to mind, but I think GET is a more appropriate method because 99% of the time you only supply a

Any method to get constant for HTTP GET, POST, PUT, DELETE? [duplicate]

落花浮王杯 提交于 2019-12-04 22:36:05
This question already has answers here : Where are the request method constants in the Servlet API? (6 answers) Closed 6 years ago . For example, HttpServletResponse has the HTTP status codes as constants like public static final int SC_OK = 200; public static final int SC_CREATED = 201; public static final int SC_BAD_REQUEST = 400; public static final int SC_UNAUTHORIZED = 401; public static final int SC_NOT_FOUND = 404; Is there any such constants defined for HTTP methods like GET , POST , ..., anywhere in the Java EE API so that it could be referenced easily, rather than creating one on my

Are REST API's really RESTful?

不问归期 提交于 2019-12-04 12:48:45
I'm new to this game so I might be misunderstanding things. Actually, if someone tells me that I'm misunderstanding things, it will be a favor. Maybe this person will be considerate enough to show me the right path. But... One of the " guidelines " or " best practices " of REST as it applies to Web Services ( http://en.wikipedia.org/wiki/Representational_state_transfer#Applied_to_web_services ) is that you should use the proper HTTP methods when making calls (did I misunderstand it?) to REST API's. But looking at many API implementations on the web, what I see is that 100% of the calls made to

Angularjs $http get method for JSONP data without CALLBACK parameter [duplicate]

假装没事ソ 提交于 2019-12-04 06:12:54
问题 This question already has an answer here : Not a Legal JSONP API — How to get data without CALLBACK parameter (1 answer) Closed last year . I have problem by printing in the table, some JSON that is on the server. This is my JSON process([ { "name": "A", "value": "41" }, { "name": "B", "value": "71" }, { "name": "C", "value": "20" }],"2017.07.11 15:48:33"); My controller: myApp.controller('liveTable', function ($scope, $http) { $http.get('http://something.com/get.php?jsonp=2017') .then

How to detect HTTP method in CodeIgniter

你。 提交于 2019-12-03 18:57:14
问题 How can I detect HTTP method in CodeIgniter controller class? Edited: Is there any other way than using $_SERVER['REQUEST_METHOD'] in CodeIgniter? 回答1: Thanks to Branden, I've found the answer. $this->input->server($index) is identical to $_SERVER[$index] . To get method you can use: $this->input->server('REQUEST_METHOD') . UPDATE: (thanks to Ecir Hana) As of CodeIgniter 3, using of method is also possible: echo $this->input->method(TRUE); // Outputs: POST echo $this->input->method(FALSE); //

Can Spring MVC handle requests from HTML forms other than POST and GET?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 07:32:53
问题 Spring 3 MVC supports all 4 of RESTful methods: GET, POST, PUT and DELETE. But does its view technology support them on forms? If not, what is the real use of method attribute in form:form tag? I tried to use PUT method on the form: <form:form action="/myaction" method="PUT"> ... </form:form> Generated HTML was: <form id="command" action="/myaction" method="post"> <input type="hidden" name="_method" value="PUT"/> ... </form> It is clear since most browsers don't support other methods besides

Can Spring MVC handle requests from HTML forms other than POST and GET?

。_饼干妹妹 提交于 2019-12-02 21:02:37
Spring 3 MVC supports all 4 of RESTful methods: GET, POST, PUT and DELETE. But does its view technology support them on forms? If not, what is the real use of method attribute in form:form tag? I tried to use PUT method on the form: <form:form action="/myaction" method="PUT"> ... </form:form> Generated HTML was: <form id="command" action="/myaction" method="post"> <input type="hidden" name="_method" value="PUT"/> ... </form> It is clear since most browsers don't support other methods besides GET and POST . But Spring can handle it with additional input with name _method and value METHOD_NAME .

Angularjs $http get method for JSONP data without CALLBACK parameter [duplicate]

非 Y 不嫁゛ 提交于 2019-12-02 11:22:39
This question already has an answer here: Not a Legal JSONP API — How to get data without CALLBACK parameter 1 answer I have problem by printing in the table, some JSON that is on the server. This is my JSON process([ { "name": "A", "value": "41" }, { "name": "B", "value": "71" }, { "name": "C", "value": "20" }],"2017.07.11 15:48:33"); My controller: myApp.controller('liveTable', function ($scope, $http) { $http.get('http://something.com/get.php?jsonp=2017') .then(function (response) { $scope.myData= response.data; console.log(response.data); }); And this is my HTML <div class="liveTable" ng