HTTP POST using PuTTY (Windows)
Go to solution
Solved by mariushm,
POST /tk1104/oppgave3d.php HTTP/1.1 Host: www.eastwillsecurity.com Origin: http://www.eastwillsecurity.com Referer: http://www.eastwillsecurity.com/tk1104/oppgave3d.php Accept: text/html,application/xhtml+xml User-Agent: PuTTY EksamenTK1104: 1234 Content-Type: text/plain Content-Length: 8 OPPGAVE3
Something like this.
Standard port for http is 80 and can be omitted, it's implicit.
replace 1234 with your actual id.
Content-Type : text/plain because you're just sending some text to the server/script, not form data.
Origin and Referer are optional.
Not 100% sure of this final part, it should be correct but maybe check it, make tests, ask someone else
You can write your own php script to test this stuff (install apache and php on your windows machine, it's super easy) and read the "request body" from php://input and dump it to a file (ex see file_put_contents function) and compare with what you send.
this outputs directly.
<?php $body = ''; $fh = @fopen('php://input', 'r'); if ($fh) { while (!feof($fh)) { $s = fread($fh, 1024); if (is_string($s)) { $body .= $s; } } fclose($fh); } echo "Body: $body"; ?>
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now