0

I am using POCO 1.9.4, configured as a server. I am trying the sample code "HTTPFormServer" from Poco libraries. I am able to display the index.html page when queried from browser. But I couldnt navigate to other html pages from index.html page (placed in same directory as index file).

I have modified the sendFile() of the handle request method as shown below. It displays index.html page when queried from browser (using "http://localhost:9980/"). But when I click any buttons at index page, it doesnt navigate to other pages I need help in understanding how to display a bundle of html files placed at a directory (starting with index.html in it).

    void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
    {
        Application& app = Application::instance();
        app.logger().information("Request from " + request.clientAddress().toString());
        app.logger().information("URI " + request.getURI()); 

        MyPartHandler partHandler;
        HTMLForm form(request, request.stream(), partHandler);

        response.setChunkedTransferEncoding(true);
        response.setContentType("text/html");

        /*std::ostream& ostr = */ response.sendFile("html1\\index.html", "text");
#if 0
        ostr <<
            "<html>\n"
            "<head>\n"
            "<title>POCO Form Server Sample</title>\n"
            "</head>\n"
                        "<html>\n"
#endif
        }
Albina
  • 1,901
  • 3
  • 7
  • 19

0 Answers0