mIRC Home    About    Download    Register    News    Help

Print Thread
$urlget and 4XX status codes #267015 21/03/20 01:28 PM
Joined: Dec 2015
Posts: 142
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 142
$urlget ignores 4XX status code response bodies.

https://www.mirc.com/helloworld
Code
//noop $urlget(https://www.mirc.com/helloworld,gb,&test,responsebodytest)

alias responsebodytest {
  echo -a state: $urlget($1).state
  echo -a size: $urlget($1).size
  echo -a reply: $urlget($1).reply
  if ($bvar(&test,0)) echo -s response: $bvar(&test,1-).text
  else echo -a response: $!null
}

Re: $urlget and 4XX status codes [Re: Dazuz] #267016 21/03/20 02:52 PM
Joined: Dec 2002
Posts: 4,736
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,736
Thanks for your bug report. That is correct. If a connection fails, mIRC will return the error in the state and reply properties and will not save the html error reply to a file or a binvar.

Re: $urlget and 4XX status codes [Re: Khaled] #267017 21/03/20 03:51 PM
Joined: Dec 2015
Posts: 142
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 142
Any chance you could add an option to save the reply? It would be nice to be able to see the error replies.