Sending a HTML form using C++?

I've been searching for a solution for days now, but nothing related to my query came up.
So, I decided to ask somewhere.

I don't know much about C++, but having a firm grasp over javascript, Jass and vJass have to count for something.. Right?

Anyways, how would I submit a HTML form using C++?
I don't know how to create GUI yet.

I just need to know if I need any libraries and which functions I'd need to send a form.

Thanks for reading =x

Note that I just need to send a HTML form using a console application.
I don't want or need to make the application receive data.
Last edited on
There are a number of libraries around that do that sort of thing, libcurl is the most widely quoted.

It's not terribly difficult to do it yourself, but if you just need the job done, it'll be quicker to use a library such as libcurl.
Umm..
What would I need to read up on if I wanted to do it myself? =x

I can't seem to get libcurl to work with MVC++ 2008.
I can build it and all..

But I can't erm.. Link it to any project.
I can't call any libcurl functions because when I try it and attempt to build..
I get this:
1
2
3
4
5
1>TestCURL.obj : error LNK2019: unresolved external symbol _curl_global_cleanup referenced in function _wmain
1>TestCURL.obj : error LNK2019: unresolved external symbol _curl_easy_cleanup referenced in function _wmain
1>TestCURL.obj : error LNK2019: unresolved external symbol _curl_easy_setopt referenced in function _wmain
1>TestCURL.obj : error LNK2019: unresolved external symbol _curl_easy_init referenced in function _wmain
1>TestCURL.obj : error LNK2019: unresolved external symbol _curl_global_init referenced in function _wmain
Looks like you're missing a .LIB file.
Yea, I finally got the lib files I needed =x
I only needed to add 3 other lib files.

Now the problem is figuring out which functions on libcurl I'll need to send HTML forms =x
I'm reading.. But it's hard >.<

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html <-- Currently reading this.
Any hints?

In javascript..
I'd need:
SomeForm.action = 'http://SomeWebsite/?SomeStuff=12345&Stuff=6789&sec=submit';
SomeForm.method = 'post';
SomeInput.type = 'text';
SomeInput.name = 'MyGorilla';
SomeInput.value = 'Gloria';

SomeForm.appendChild(SomeInput);
SomeForm.submit;
What would I need to read up on if I wanted to do it myself?


You need to send the HTTP request over TCP.

This is a sample TCP client that sends some text.
http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15213-f99/www/class26/tcpclient.c

This is the HTTP protocol that defines how you send your request.
http://en.wikipedia.org/wiki/Http_protocol
http://tools.ietf.org/html/rfc2616
Topic archived. No new replies allowed.