Pranav Saxena
Pranav Saxena
``` router["/image"] = JSONResponse(handler: {environ -> Any in let input = environ["swsgi.input"] as! SWSGIInput DataReader.read(input) { data in // get the image bytes from the request object funcABC(data) startResponse("200 OK",...
I did try this before and it gives me a compilation error at the `handler:{ (`: `Unable to infer closure type in the current context`. I am using swift 4.1...
It works if I change `Any` to `void` and I do get the bytes of the image uploaded. But I wonder how do I extract the image content from there...
I actually figured out the problem. When I used curl with `--data-binary @temp.jpg` , that worked like a charm. All the bytes were correctly received and processed. When I used...