i am developing a program part of which is a simple web server, i am trying to work the format of POST requests from html forms because my program needs to recieve a POST request and parse it to read what data the http request is POSTing. while writting the rest of my program i used this simple script and some home made html to reverse engineer http.
Code:
#!/usr/bin/ruby
require 'socket'
server = TCPServer.new('0.0.0.0', '8080')
while (session = server.accept)
puts session.gets
end
and then i used this html page to try and find out how POST requests look
Code:
<html>
<body>
<form method=post action="ht tp ://127.0.0.1: 808 0/t est.cgi">
<input name="track" type="checkbox" value="biffy.mp3">
<input name="track" type="checkbox" value="biffy234.mp3">
<input type=submit>
</form>
</body>
</html>
PLEASE IGNORE SPACES IN THE URL, HAD TO PUT THEM THERE BECAUSE THE BOARD SOFTWARE ACCUSED ME OF SPAMMING BECAUSE ITS MY FIRST POST
when i click on the submit button all i get output wise from my script is
Code:
POST /test.cgi HTTP/1.1
and nothing else
so i need to find out either
- whats wrong with my reverse engineering setup
- the syntax of POST including all details like what seperates the data from different parts of the form
thanks
mofofish