Hello World! - 3/9/2022 by Jemma

    Hello World!

    Hello World! My name is Jemma, if you got here I'm assuming you've either already read my website or already know me :p

    I saw my friend Ash recently start blogging again, and I wanted to try getting into it myself (and this definitely isn't an excuse to avoid writing a giant paper due in 2 weeks lol)

    So what do I write about?

    That's where I'm stuck. I have a number of projects that I'm working on, and I'm not sure what I want to write about. So here's what I'm gonna do instead: I'm gonna ramble about some random school assignment I was stuck on recently, and we'll see if I actually keep doing this.

    Background Info:

    While I'm fairly experienced in programing in JS and other web technologies, C++ is not my strong suit. I'm currently in an intermediate software engineering class that has a semester long group project in C++. Our project is using the Steam web API to get information about games, and keep logs about your playtime and showing statistics about your library.

    Okay, that's pretty straight forward, what's the problem?

    I'm a dumbass

    So networking support in C++ is not something I've played around with too much. I once attempted to create a web server on a Wii U (which unfortunately that code is long gone -_-), but aside from that I knew nothing. So I naively googled network requests in C++ and ran into the cpr library. Okay, great! Let's just slap and in and call it good and-

    Oh wait. My group members don't have their own PC's to work on the project. So we can't install dependencies on the school computers. (not to mention the fact that we're stuck using Visual Studio & Windows forms, so switching to cmake would be a pain at this point)

    My Implementation:

    At this point I realized that I would likely have to use a built-in system library and started doing some digging. What I came across was WinHTTP, an HTTP/2 interface. It's a pretty neat, it's got support for IPv6 and the WebSocket protocol, but it's extremely high level, so I have to sit down and hammer out my own implementation for GET and POST requests.

    I actually got pretty far into my own (frankly terrible) implementation, before running into this example implementation that was better than mine in every way. So took it and turned it into a nice library that I can use in my projects.

    So now making requests to the Steam web API is as simple as this:

    Wrapping Up

    Unfortunately I can't share the source code for any of this at the moment as this is still an in-process assignment, and I'd rather not get myself in trouble. But this was honestly really fun to write (even if it was just a whole lot of nothing) and I do want to write more posts about my personal projects in the future.

    Thanks for reading if you made it this far, have a cookie :) 🍪