Is httppost working ?

new BookmarkLockedFalling
Michociech
New Member
*

Michociech Avatar

Posts: 1Male

Post by Michociech on Mar 20, 2014 9:49:36 GMT -5

Hello

In RunBasic program i have:
ans$=HTTPPOST$("http://some.adress/test.php", "t=ttt")
print ans$

In test.php is:
<?php
print_r($_POST);
?>

I trying to send:
?t=ttt
"t=ttt"
"?t=ttt"
t="ttt"
?t="ttt"
ttt
"ttt"

and always answer is:
Array
(
)

loking that nothing was send to test.php


When I using script:
open "aaaa.vbs" for output as #vbs
print #vbs, "strPostData = "; chr$(34); "t=ttt"; chr$(34)
print #vbs, "With CreateObject("; chr$(34); "MSXML2.XMLHTTP"; chr$(34); ")"
print #vbs, " .open "; chr$(34); "POST"; chr$(34); ", "; chr$(34); "http://some.adress/test.php"; chr$(34); ", False"
print #vbs, " .setRequestHeader "; chr$(34); "Content-Type"; chr$(34); ", "; chr$(34); "application/x-www-form-urlencoded"; chr$(34)
print #vbs, " .send (strPostData)"
print #vbs, " a = .ResponseBody"
print #vbs, "End With"
print #vbs, "With CreateObject("; chr$(34); "ADODB.Stream"; chr$(34); ")"
print #vbs, " .Type = 1"
print #vbs, " .Mode = 3"
print #vbs, " .Open"
print #vbs, " .Write a"
print #vbs, " .SaveToFile "; chr$(34); "ans.txt"; chr$(34); ", 2"
print #vbs, " .Close"
print #vbs, "End With"
close #vbs
vbs$ = "cscript.exe aaaa.vbs "
run vbs,ドル hide

this working good

PS. Of course "http://some.adress/test.php" is not real adress.


--
Best regards
Michociech
neal
Full Member
***

neal Avatar

Posts: 104