Hello all,
I was wanting to know how to make a HTTP request. I know the structure of it (header, get, post, etc.) but don't actually know how to make it.
Is there a program I use, or a file type, or a server, etc. (May sound stupid but I'd like to know).
Thank You.
HTTP Request
Started by hetra, Jun 06 2010 11:43 PM
5 replies to this topic
#1
Posted 06 June 2010 - 11:43 PM
|
|
|
#2
Posted 07 June 2010 - 01:12 AM
The HTTP protocol can be used in many ways, and is simply just plaintext. You need something to implement the protocol, to be able to traverse or do anything useful with it.
You can open up your command prompt and run this:
Once you are connected, you can write the header to the website. An example is this:
CLRF being the enter key of course. I'm not sure what you're wanting to do with it, "Make" isn't specific.
Programatically, [link: libcurl] could provide easy implementation, but there are too many language specific things.
You can open up your command prompt and run this:
telnet www.google.com 80
Once you are connected, you can write the header to the website. An example is this:
GET / HTTP/1.1 [clrf] Host: www.google.com [clrf] [clrf]
CLRF being the enter key of course. I'm not sure what you're wanting to do with it, "Make" isn't specific.
Programatically, [link: libcurl] could provide easy implementation, but there are too many language specific things.
#3
Posted 07 June 2010 - 10:26 PM
So, what about an implementation for SMTP or FTP?
Thanks for the help.
Thanks for the help.
#4
Posted 08 June 2010 - 02:13 AM
To connect to these, you'll basically just be required to use C++'s functions (fsockopen, and alike). There are many examples on the web:
[Link: http://www.codeproje...ientclass.aspx]
[Link: C++ SMTP Example - Stack Overflow]
Of course other languages can use their own libraries; Python and Perl (in CPAN) should provide modules for FTP or alike. There really aren't any major APIs out there, as it's just mid level networking stuff.
[Link: http://www.codeproje...ientclass.aspx]
[Link: C++ SMTP Example - Stack Overflow]
Of course other languages can use their own libraries; Python and Perl (in CPAN) should provide modules for FTP or alike. There really aren't any major APIs out there, as it's just mid level networking stuff.
#5
Posted 08 June 2010 - 09:57 PM
recv is the recieving function, what is the sending function?
#6
Posted 09 June 2010 - 01:15 AM
sendto() will do:
ssize_t sendto(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr,
socklen_t dest_len)
Why not look at all the goodies of the socket.h you're including?:
[Link: http://www.opengroup.../socket.h.html]
ssize_t sendto(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr,
socklen_t dest_len)
Why not look at all the goodies of the socket.h you're including?:
[Link: http://www.opengroup.../socket.h.html]


Sign In
Create Account


Back to top









