Hello,
I want convert this code PHP for AutoIt
<?php
$request = fsockopen('ssl://simple-note.appspot.com', 443);
if ($request) {
echo 'connectOK<br />';
}
$headers_string = "POST /api/login HTTP/1.0rnHost: simple-note.appspot.comrnContent-type: application/x-www-form-urlencodedrnContent-length: 68rnConnection: ClosernrnZW1haWw9c2ltcGxlbm90ZSU0MGhvdG1haWwuZnImcGFzc3dvcmQ9bW90ZGVwYXNzZQ==";
fwrite($request, $headers_string);
$response='';
while (!feof($request)) {
$response .= fgets($request, 1024);
}
echo $response;
?>
I create this
#include <WinHttp.au3>
Global $sDomain = "simple-note.appspot.com"
Global $sPage = "api/login"
$headers_string = "POST /api/login HTTP/1.0"&@CRLF&"Host: simple-note.appspot.com"&@CRLF&"Content-type: application/x-www-form-urlencoded"&@CRLF&"Content-length: 68"&@CRLF&"Connection: Close"&@CRLF&@CRLF&"ZW1haWw9c2ltcGxlbm90ZSU0MGhvdG1haWwuZnImcGFzc3dvcmQ9bW90ZGVwYXNzZQ=="
Global $hOpen = _WinHttpOpen()
; Get connection handle
Global $hConnect = _WinHttpConnect($hOpen, $sDomain)
if @error Then MsgBox(16, "", 1)
$sData = "ZW1haWw9c2ltcGxlbm90ZSU0MGhvdG1haWwuZnImcGFzc3dvcmQ9bW90ZGVwYXNzZ=="
$hRequestSSL = _WinHttpSimpleSSLRequest($hConnect, "POST", $sPage, $sData)
if @error Then MsgBox(16, "", 2&@CRLF&@error)
MsgBox(0, "", $hRequestSSL)
but it does not work...
Please Help me