http request with image as data

Hi. Is it possible to make a http post request sending an image as the parameter?

Yes - but I don’t think you can in Codea; at least not directly.

Or rather - you can in 1.5 (currently beta), but it’s really roundabout; you have to save your image to your Documents, then use the io.* module to read the data back out of the saved image - then post it via http.

@tnlogy Did you ever figure out how to make an http post request sending an image as a data parameter? I’ve looked everywhere and there doesn’t seem to be an easy way to do this?

No, I didnt. Doesnt seem to be supported. You have to read out the pixels and send it as base64 for example I guess. I used the runtime instead and wrote an extension.

@tnlogy That’s a bummer. I have no idea how to send it as bas64 and/or write an extension. :frowning: You would think that since it’s so easy to receive an image that there would be an easy to way to send a picture.