During the second week, I worked on my assigned project and also received kind guidance from Dr Shawn whenever I’m stuck. My project involves processing final scores of participants in a competition. This calls for pulling data from a CouchDB database after all the marks by judges are dialed in, or simply after the competition has closed. The Poco library is used.
I start by writing some code to fetch data from the server. To do so, I use the HTTPClientSession constructor, with the right host and port set as parameters.
Next, I use the HTTPRequest constructor to send a GET request. With StreamCopier’s copyStream function, it can display the content of the chosen server.
I also use HTTPBasicCredentials to ensure I have access to the server.
Initially there were errors in compiling my files because the Poco header files can’t be compiled. To resolve this, I link the libraries that couldn’t be compiled. For my case I would add “-lPocoNet” and “-lPocoFoundation” in the compiler.