Search code examples
c++httprequesthttpserver

images not found in response with libmicrohttpd


I have made a simple application utilizing microhttpd that displays a page on request. The page has some text on it which is correctly displayed but the images are not found how do I provide these images? from what I understand, I should provide them at the same time with the response page but i don't understand how. I've tried looking at the tutorials/documentation of microhttpd but i haven't found a clue.


Solution

  • The images are requested by the browser in separate requests. The server has to send a response for each image. The first request is for the HTML file, e.g. index.html. A later request is for the image file, e.g. image.png. You have to implement a routing for this.