greptilian logo

IRC log for #rest, 2015-11-12

https://trygvis.io/rest-wiki/

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:09 lemur joined #rest
00:55 pdurbin yeah
01:10 lemur joined #rest
01:11 fuzzyhorns joined #rest
01:31 devinclark joined #rest
02:00 devinclark joined #rest
02:09 devinclark joined #rest
02:10 wavded joined #rest
02:47 sfisque joined #rest
03:01 devinclark joined #rest
03:11 baweaver joined #rest
03:21 devinclark joined #rest
03:33 wavded joined #rest
04:12 baweaver joined #rest
04:16 devinclark joined #rest
04:28 baweaver joined #rest
04:30 devinclark joined #rest
06:35 devinclark joined #rest
07:06 devinclark joined #rest
07:15 rickharrison joined #rest
07:17 riddle joined #rest
07:20 lemur joined #rest
07:53 rosstuck joined #rest
08:12 fumanchu_ joined #rest
08:21 baweaver joined #rest
09:00 interop_madness joined #rest
09:23 baweaver joined #rest
09:48 graste joined #rest
10:23 baweaver joined #rest
11:24 baweaver joined #rest
11:32 fumanchu joined #rest
11:36 devinclark joined #rest
12:25 baweaver joined #rest
12:46 logikos sorry i had left the office by the time you replied last night.
12:46 logikos pdurbin: i am using multipart/form-data as it has native support in all browsers
12:47 logikos you cant urlencode an entire file...
12:55 logikos the actual database record does not contain the file contents but a reference to the location of the file .. i *could* send the file(s) up through separate requests and then PUT the record once they all finish uploading .. but it seems rather silly when they can all be easily sent together with POST & form-data
12:56 logikos the client would not know a resource id for the files .. but it could generate a UUID and the server could be forced to use that...
12:56 logikos seems like a lot of extra trouble though...
13:09 rosstuck joined #rest
13:09 pdurbin logikos: did what whartung say help at all?
13:14 mezod joined #rest
13:17 wsiqueir joined #rest
13:26 baweaver joined #rest
13:30 wavded joined #rest
13:32 logikos 'The problem with formdata is that it's typically not the data type for the resource. '
13:32 logikos i'm not sure what to do with that
13:33 logikos 'the resource' most often is a database record
13:33 logikos files are not stored in the database but on the file system, and the database records the location of the file
13:33 logikos as part of the record
13:35 logikos I can do everything I need to do with POST .. it is just that in reading about REST I really like the concept and want to start using it ... but I have found it difficult to understand how to best handle some situations like this one
13:37 logikos normally i would just create some convention and document it and so long as it is followed the program will always work just fine .. but if there is already a well established RESTful convention it would make sense to use it rather than make one up myself
13:39 interop_madness not sure what the context is, but i think multipart/form-data has huge advantages as soon as and endpoint should be able to (even optionally) receive files
13:40 logikos yes but it is limited to POST
13:41 logikos the context and original question was if it is 'OK' to use POST when updating records
13:41 logikos POST allows me to submit the record along with the files referenced in the record with form-data
13:42 interop_madness not sure what you mean by "limited to POST". you can certainly allow PUT requests carrying multipart/form-data
13:42 logikos there is very low native browser support for <form method=PUT
13:43 interop_madness oh ok you need browser support
13:43 logikos I could (and may do so anyway)  do it myself with javascript
13:43 logikos but even serverside (with php)
13:43 logikos there is native form-data support with POST requests
13:44 logikos but not PUT
13:44 logikos with PUT you just get the raw input and would have to build something to parse it myself
13:44 interop_madness this sucks
13:44 logikos which i could do (or find one already made by someone else)
13:44 logikos but it just doesnt seem like a good solution
13:44 logikos besides the file is not really part of the record, it is referenced in the record
13:44 logikos but needs stored for the record to be created
13:45 interop_madness hmm, concerning the latter problem, i had a similar issue (PUT vs. POST problem ignored)
13:45 logikos so I can use POST and handle it server side, or client side i can PUT each file one at a time to some UUID and then submit the record with PUT referencing those UUID's for the files
13:45 logikos but that is many requests to the server when form-data is already built to handel it
13:47 interop_madness i had the requirement for an endpoint that it must take a) some custom mime type representing the resource (which internally might have 0-n files), b.) arbitrary mime types representing files (i.e. create a resource with that file as content)  and c.) a reference to files already present in the system (add that file as content)
13:47 interop_madness so i just defined a custom mime type for case c. and had special treatments for multipart/form-data and cases a and c
13:51 logikos what language are you using server side ?
13:52 interop_madness C#
13:53 interop_madness i used 3rd party code for the multipart/form-data parsing
13:54 logikos ah
13:55 interop_madness but i'm not happy with that code, because it dumps all files to temporary storage and doesn't handle the input stream as stream. a proper multipart/form-data parser IMHO would need to have an event-based architecture where an event is raised whenever the parser processing the stream encounters a part
13:55 interop_madness then the caller could decide how to handle the stream for that particular part
14:01 logikos PHP handles it the same way, by the time my script executes the upload is finished and temporary files created, PHP provides me with a link to those files and the other meta data related to the files (such as original filename etc)
14:25 devinclark joined #rest
14:27 baweaver joined #rest
14:30 devinclark joined #rest
14:31 devinclark joined #rest
15:06 devinclark joined #rest
15:21 simonv3 joined #rest
15:27 baweaver joined #rest
15:43 baweaver joined #rest
16:07 devinclark joined #rest
16:37 devinclark joined #rest
16:38 devinclark joined #rest
16:54 baweaver joined #rest
17:55 lemur joined #rest
18:01 whartung joined #rest
18:41 fumanchu joined #rest
18:49 wavded joined #rest
18:56 lemur joined #rest
19:09 devinclark joined #rest
19:27 devinclark joined #rest
20:09 interop_home joined #rest
20:09 interop_home joined #rest
20:11 anth0ny joined #rest
20:37 Coldblackice joined #rest
20:48 simonv3 joined #rest
20:53 rosstuck joined #rest
20:58 baweaver joined #rest
21:05 anth0ny joined #rest
21:19 anth0ny joined #rest
21:59 lemur joined #rest
22:42 interop_home joined #rest
22:42 interop_home joined #rest
23:00 lemur joined #rest
23:20 fuzzyhorns joined #rest
23:56 trygvis joined #rest

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

https://trygvis.io/rest-wiki/