Time  Nick      Message
13:50 siwica    When sending a file to the server which is not supposed to stay there (just some data gets extracted) which is the appropriate request: POST or PUT?
13:53 * pdurbin votes for POST
13:54 siwica    pdurbin: and what is the canonical way to send file content (textual) via a POST request? just an arbitrary key-value par with value being the file  content?
13:54 siwica    *pair
13:55 pdurbin   multipart, I would think
13:57 trygvis   there is no canonical way to do that
13:57 pdurbin   "Content-Type should be set to multipart/form-data" https://dev.twitter.com/rest/reference/post/statuses/update_with_media
13:58 trygvis   twitter is a classic RPC API, not anywhere near REST
13:59 pdurbin   siwica: are you going for REST or "whatever works"? :)
13:59 siwica    pdurbin: not sure yet :)
14:00 trygvis   do you want to send a set of key/value pairs plus the file itself?
14:00 * pdurbin wonders if there's a #restful or #whateverworks channel
14:00 siwica    pdurbin: I want to pass a file to the server, the server extracts multiple entities from it and privides GET access to each of those
14:00 siwica    The file is XML
14:00 siwica    And I only want to send the file itself
14:01 trygvis   then POST the file to your service
14:02 trygvis   PUT is expected to be a complete representation of the resource you're replacing, while POST has no such ideas
14:03 siwica    trygvis: Ok, I see
14:05 siwica    pdurbin: What does "multipart/form-data" do, if I am only sending a single file with nothing else?
14:10 trygvis   it enabled you to send more than one file in a single container, usually it's used to send two files, one which contains instructions and one that is the 'main' payload
14:10 trygvis   enables
14:10 trygvis   and saying 'usually' is probably not right, but it can be used to do that at least
14:19 siwica    Ok, I see
14:59 pdurbin   trygvis: no canonical way? REST doesn't specify a way?
15:40 mamund    pdurbin: "REST doesn't specify a way?" -- that's correct.
15:41 mamund    REST is not a protocol, it's a style like impressionism or swedish modern, etc.
15:41 mamund    HTTP is a protocol and has several specifications.
15:42 pdurbin   sure does. several efforts to summarize and reconcile the various specs
15:42 mamund    one of the specs related to HTTP is the "multipart/form-data" spec (RFC2388)
15:42 mamund    https://www.ietf.org/rfc/rfc2388.txt
15:43 mamund    this is a spec for transfering whole files.
15:43 mamund    hope that helps.
15:43 pdurbin   It does. Thanks. I wasn't aware of that RFC.
15:43 mamund    np
15:43 mamund    it's a bit dated, but it's the one browsers supprt
15:44 mamund    and most frameworks has built-in support for it, too.
15:44 mamund    makes it easy to implement for both servers and clients.
15:45 pdurbin   cool