ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.46k stars 889 forks source link

Is it possible to send bytes by post method? #371

Open XingBin111 opened 4 years ago

XingBin111 commented 4 years ago

I want to send a image to server, and use CNN to predict its class, how can I send a image to server by post method?

The-EDev commented 3 years ago

Looking at how crow handles requests, It seems that everything is sent as std::string, which means getting a multipart form file will give you the same thing as opening a .png file in notepad. So you'll need to either find a way to convert the multipart form string to binary (which I don't think should be difficult, but is rather slow IMO), or change the source code in http_request.h and maybe some other files to take the request as binary by default (maybe std::vetor<uint8_t>).

I'm saying "you need to" because this library is no longer in active development, and while a few developers (including myself) are interested in maintaining it, we may not have the time to modify it as much as we like to.