'Posting' in HTML

Started by
6 comments, last by DividedByZero 16 years, 6 months ago
I recently downloaded an API for a particular website that requires you to 'post' messages to perform various tasks at their end. For example updating user details and the likes. I understand how there API works but do not know how to 'post' messages in HTML. Can anyone please shed some light on how to post a message? I have googled but this doesn't seem to clear it up for me, unfortunatly. Thanks in advance.
Advertisement
Wait, HTML or HTTP ?
Sorry, you are right it think. Probably HTTP within HTML code.
To send a HTTP message you just send a certain text string over TCP to the according server, that's all. Take a look at 'http://www.jmarshall.com/easy/http/' for further help.

--
Ashaman
Quote:Original post by lonewolff
Sorry, you are right it think. Probably HTTP within HTML code.


It's the other way around.

HTML is a way of formatting data that is sent over the internet.

HTTP is a way of sending the data. That's why URLs (URIs?) start with 'http://'; it indicates the protocol (the 'P' in http) that will be used to send the data.

Normally, when you send a message to the web server, you don't send anything in HTML. Instead, you send a request for data, either a HEAD, GET or (apparently what they want you to use this time) POST request. The data you receive in response typically has a header, followed by (for non-HEAD requests) the contents of the thing you requested. When that thing is a web page (.htm or .html extension), it typically consists of HTML data (hence the extension).
Quote:Original post by Ashaman73
To send a HTTP message you just send a certain text string over TCP to the according server, that's all. Take a look at 'http://www.jmarshall.com/easy/http/' for further help.

--
Ashaman
Or use something like libcurl, to save re-inventing the wheel.
And in the event that you actually just need HTML instead of doing it through code...

<form name="input" action="http://somesite.com" method="get">
... put stuff here
</form>

changes to...

<form name="input" action="http://somesite.com" method="post">
... put stuff here
</form>
Check out my current project on Kickstarter: Genegrafter
Awesome guys, those explanations explain heaps. I didn't realise it was more or less a clear text thing.

@Darkpegasus it was the HTML way I needed, thanks. But it is good to know that it shouldn't be too hard to write a utility to do some admin tasks, rather than have a webpage to do it.

Thanks heaps everyone, i'll give that all a try.

This topic is closed to new replies.

Advertisement