Fork me on GitHub
#yada
<
2017-10-12
>
genRaiy10:10:38

hi peeps ... wondering if anyone out there has an example of multipart/form-data handling in Yada?

malcolmsparks11:10:35

Edge actually has an example for its phonebook PUT updates

genRaiy13:10:46

oops - I didn't look there 😕

genRaiy14:10:56

with my experiments it seems like :body has the processed form-data but the keys are not coerced ... is that right?

genRaiy14:10:15

[ makes sense for files of course ]

genRaiy14:10:16

are there any helpers / options for this? [ ok if not, just wanted to check ]

malcolmsparks14:10:25

There is a special map produced in the ctx called :yada.multipart/parts iirc. It has more part metadata. Look out for it.

genRaiy14:10:10

ok, thanks ... the bytes for the data in the body seem to include headers which seems a bit weird

genRaiy14:10:17

for example

genRaiy14:10:12

I'll check the parts map you mentioned...

genRaiy14:10:35

seems like :body-offset is my freind

genRaiy14:10:12

[ and of course the parts are the same as the body without the keys ]