mIRC Home    About    Download    Register    News    Help

Print Thread
#271342 20/02/23 12:06 PM
Joined: Feb 2023
Posts: 3
S
sadlol Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
S
Joined: Feb 2023
Posts: 3
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]

sadlol #271343 20/02/23 01:26 PM
Joined: Jul 2006
Posts: 4,155
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,155
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"


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard