Image on the server side

Jun 26, 2013 at 12:41 PM
Hi,

I'm working on the release 0.5. I'm trying to build a web service with a C++ server.
The server seems to work fine. Now, I'd like to be abble to get an image from a browser (client-side) just by calling the good URL.
Is that possible and how should I proceed ? Is there a mean to change the content-type of the reply sent ?

Thanks in advance.
Jun 27, 2013 at 4:55 PM
Emilien,

I'm not sure I completely understand your scenario.

You have built a server with the C++ library we provided (the MSDN DevLabs version, not the very latest, of course).

Now, are you trying to upload an image file to the web service from a browser, right (you said from a browser)? What you do in the browser is outside the scope of Casablanca, I expect that you'd use a HTTP POST to send the file up, which means that the service must be prepared to accept POST requests (this is the scope of Casablanca).

Or are you trying to download a file (you're asking about setting the content-type of the reply)? If so, there are overloads on reply() that take the content-type, or you can construct the reply object and set the Content-Type header yourself before sending it back.

Niklas
Jun 28, 2013 at 7:18 AM
Hi,

Actually, I tried to dowload an image file, so the problem was about the content-type. I've just found the overload on reply(). Thanks a lot !

Emilien.