Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I think you may need a bit more parameters :) like headers. At least info for Authorization header
edit: unless you make passing auth data as a separate method and store it inside the object.. But then it might be difficult to determine whether get() failed or whether it failed due to expired credentials.
Unless you throw exceptions. But then exception handling will litter your nice and clean code 😁
and then there is the request params. Sure you can concat them to a single string and append to url, but I doubt it will not litter your code as well [before the get call]. Pasing a const static char* also is questionable as rest apis use dynamic urls to access resources. And params are somewhat of a dynamic thing as well. -
@netikras It's going to be a sort of drill-down abstraction of overloaded methods. get will just reference a more generic request method with some predetermined request options
Related Rants
-
xjose97x20Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop. -
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ... -
sam966911
Hats off to this lady .... I would have just flipped the machine

I am currently in a bit of a (well-deserved) lull at work, both of my projects are finishing up/ finished, so tomorrow should be pretty light, as the latter half of today was.
And I have really gotten interested in the HTTP protocol. It's so interesting learning how it all works under the hood.
So I think I'm going to be researching/ messing around with creating a cpp project that essentially implements cURL from the ground up, creating sockets, reading from them, parsing the HTTP requests... all that. I don't expect to actually get it done, but it should be an immense learning experience. I have a clear goal: implement this function:
std::string get(const std::string&);
Once I'm able to just GET as simple as that, I know I have achieved my goal!
rant
c++
http(s)