put

Can HTTP PUT request have application/x-www-form-urlencoded as the Content-Type?

会有一股神秘感。 提交于 2019-11-29 17:33:58
问题 Is it valid to send form data in an HTTP PUT request? If you could point me to a spec then that would be great. I have gone through the HTTP 1.1 spec. But I did not find whether PUT requests can have form data or not. I am using Java for creating and accessing RESTful webservices. POST supports application/x-www-form-urlencoded as the Content-Type. From the specification, I understand that POST is for creating a new resource (a subresource to the resource identified by the request URI) and

Are PUT and POST requests required/expected to have a request body?

北城余情 提交于 2019-11-29 16:14:39
问题 I'm writting a RESTful api, and at I'm thinking about the process of a user creating a key. I have the following possibilities: GET request to /new/<keyname> - although it's very easy I think I won't use this, because I heard GET is for retrieving and/or listing information; POST request to /<keyname> - This seemed to me easy and simple enough, but does not pass any data in the request body. Can I do it this way ? Is this weird ? POST request to /keys passing in the request body "keyname

File Upload via HTTP PUT Request

亡梦爱人 提交于 2019-11-29 15:00:48
问题 Does anyone have any idea of any products or libraries like Apache Commons FileUpload that will deal with PUT file uploads? Any friendly advice or direction would be very much appreciated! Full Story: We are starting to implement a file upload rest(like) service for our java webapp, but there doesn't seem to be any 'easy' solutions for dealing with file uploads via the HTTP PUT method. We are hoping to find a library like the Apache Commons FileUpload project, but something that doesn't only

How to get filename in php in put request

走远了吗. 提交于 2019-11-29 11:51:55
I know we can read put request in file using file_get_contents("php://input"); But how do i get the filename in the put request? Filename is not sent as a part of the request. If you want to get the filename on the server side, you will have to pass it along by other means, i.e. query parameters. If you're using PUT like in PUT Method Support page, you can get the filename they PUT to as $_SERVER['REQUEST_URI'] For example, if I have the receiving PHP script <?php /* PUT data comes in on the stdin stream */ $request_body = @file_get_contents('php://input'); error_log("Received PUT, filename: {

Laravel form html with PUT method for PUT routes

£可爱£侵袭症+ 提交于 2019-11-29 10:51:53
问题 I Have this in my routes : +--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+ | Domain | URI | Name | Action | Before Filters | After Filters | +--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+ | | GET|HEAD / | | postcontroller | auth | | | | GET|HEAD login | | homecontroller@dologin | | | | | POST login | | homecontroller@dologin | | | | | GET

RESTful Soft Delete

一世执手 提交于 2019-11-29 10:39:58
问题 I'm trying to build a RESTful webapp wherein I utilize GET, POST, PUT, and DELETE. But I had a question about the use of DELETE in this particular app. A bit of background first: My webapp manages generic entities that are also managed (and, it happens, always created) in another system. So within my webapp, each entity will be stored in the database with a unique key. But the way we will be accessing them through URLs is with the unique key of the other system. A simple example will make

Which REST operation (GET, PUT, or POST) for validating information?

空扰寡人 提交于 2019-11-29 06:42:43
问题 My users enter a few information fields in a iOS app. This information must be validated on my server, which has a RESTful API. After validation the UI of the iOS app changes to indicate the result. Neither GET, PUT, or POST seem to be appropriate, because I'm not getting a resource, and neither is a resource created or updated. What is the best fitting REST operation to implement this validation? 回答1: My users enter a few information fields in a iOS app. This information must be validated on

Spring Data REST - PUT request does not work properly since v.2.5.7

浪子不回头ぞ 提交于 2019-11-29 03:47:27
Since version 2.5.7 Spring Data REST does not properly perform a PUT request to update resource which has associated resources . Unlike PATCH request that works as expected! For example, Person has a many-to-one association with Addres . If we perform a PUT request with SDR v.2.5.6 (Spring Boot v.1.4.3) then all works OK. But if we switch to version 2.5.7 (i.e. to Spring Boot v.1.4.4) then we get an error: Can not construct instance of Address: no String-argument constructor/factory method to deserialize from String value The same happens with other types of associations, for example with one

How can I send an HTTP PUT request in Ruby?

一个人想着一个人 提交于 2019-11-29 03:11:51
I am trying to send a PUT request to a particular URL, and have thus far been unsuccessful in doing so. If I were doing it through an HTTP requester GUI, such as this one, it would be as simple as doing a PUT on the following url: http://www.mywebsite.com:port/Application?key=apikey&id=id&option=enable|disable Note that a port number is specified in the above request. I will also need to do that when submitting the request through the ruby code. How can I replicate such a request in Ruby? Larry OBrien require 'net/http' port = 8080 host = "127.0.0.1" path = "/Application?key=apikey&id=id

How to specify python requests http put body?

北战南征 提交于 2019-11-28 23:52:35
问题 I'm trying to rewrite some old python code with requests module. The purpose is to upload an attachment. The mail server requires the following specification : https://api.elasticemail.com/attachments/upload?username=yourusername&api_key=yourapikey&file=yourfilename Old code which works: h = httplib2.Http() resp, content = h.request('https://api.elasticemail.com/attachments/upload?username=omer&api_key=b01ad0ce&file=tmp.txt', "PUT", body=file(filepath).read(), headers={'content-type':'text