mIRC Homepage
Posted By: sadlol send date - 20/02/23 12:06 PM
When I build an app with mit app
And it saves information on tiny web db
This is the information she sends and receives back.
I used the sniffer to find out what she was sending.

I tried the same through mirc script
And I accept
HTTP/1.1 408 Request Timeout

alias twdb {
sockopen twdb sadlol.atwebpages.com 80
}

on *:sockopen:twdb:{
if ($sockerr) {
echo -a Error: Unable to connect to TinyWebDB server.
return
}
set -u1 %tt sockwrite $sockname

%tt POST //storeavalue HTTP/1.1 $+ $crlf
%tt Accept: application/json $+ $crlf
%tt Content-Length: $23+ $crlf
%tt Content-Type: application/x-www-form-urlencoded $+ $crlf
%tt Host: sadlol.atwebpages.com $+ $crlf
%tt Connection: Keep-Alive $+ $crlf
%tt tag=test&value=%22ooo%22 $+ $crlf
}

on *:sockread:twdb:{
var %data
sockread %data
echo %data

if ($gettok(%data,1,32) == "HTTP/1.0" && $gettok(%data,2,32) == "200") {
echo -a Value saved successfully.
} else {
echo -a Error: Unable to save value.
}
sockclose $sockname
}




[img]https://drive.google.com/file/d/1BbluxAKbEZabaxxHgZrJZsQGEw6kXqVm/view?usp=sharing[/img]
Posted By: Wims Re: send date - 20/02/23 01:26 PM
set -u1 %tt sockwrite -n $sockname

%tt POST //storeavalue HTTP/1.1
%tt Accept: application/json
%tt Content-Length: $23+ < you have an issue here $23+ is going to be invalid length
%tt Content-Type: application/x-www-form-urlencoded
%tt Host: sadlol.atwebpages.com
%tt Connection: Keep-Alive
%tt
%tt tag=test&value=%22ooo%22
update %tt to include the -n switch, and then change accordingly, you have to send an empty crlf before the data you want to send, you need to fix your content length as well, you meant hardcoded 23, then use "%tt Content-Length: 23"
© mIRC Discussion Forums