Originally Posted by
BoerBert
Sorry, don't see how switching language is going to help me. I would still have to dive into the http protocol to figure out how to handle all the overhead like cookies and the cookiejar etc and write code for it. Maybe I'm wrong, but I don't see how I can post data without this.
No, you should not need "to dive into the http protocol", though at least some understanding of it would be useful. Programming languages that tend to be more commonly used for web programming than C and C++ also tend to have either built-in or better (as in a higher level of abstraction) library support for what you want to do. For example, using the suggestion of Python, your request could be answered with:
Code:
import urllib
remote_file = urllib.urlopen('http://example.com')
print(remote_file.read())
In PHP, with url_fopen_wrappers enabled, you could write:
Code:
echo htmlspecialchars(file_get_contents('http://example.com'));
Originally Posted by
BoerBert
I've seen the examples. I'm convinced it is very easy when you know the http protocol and c++. Both of them I don't know. (...) I'm at the "hello world" level now. I'm able to get some input, manipulate a variable and provide some output.
Sorry, but you are trying to run before you can walk. Not knowing HTTP is one thing; not knowing even the basics of C++ spells disaster. I agree with Salem: you need to spend time learning the basics first. For example, obtain a copy of Accelerated C++ and work through it.
Originally Posted by
BoerBert
If I just look at the examples I see about 10 lines of code for a simple get or post request. The cookie example has 3 screens of code!
Well, I can understand a newbie being initially intimidated by "3 screens of code", but that is irrelevant anyway since you don't intend to deal with cookies. If "about 10 lines of code" freaks you out, then you are really not ready.
Originally Posted by
BoerBert
In a browser I don't have to bother about options, cookies etc, I only select a link. I would expect something like that to be available in a c library. Just provide the url and return te result. Apparently I'm wrong
Have you even tried the simple HTTP example, which "shows how to get a remote web page in only four libcurl function calls"?