Custom Methods
Currently, mIRC has a hard set list of request methods the user can pick from: HEAD, GET, POST, PUT, PATCH, and DELETE.

This has two issues:
1. The OPTIONS and TRACE methods are missing
2. It does not allow for custom/non-standardized methods to be used. The spec allows servers/hosts to use custom methods so long as they follow the format requirements. For example, a host I deal with has a REVERT method that mIRC's $urlget() can't make use of



Splitting and Processing of Status Line
The .reply property returns the full head of the response. Typical behavior with client libraries is to pull out the HTTP version, status code and status text from that reply line to make client-side processing easier; I suggest something of the following:
Code
;; HTTP/1.1 200 OK
echo -ag Reply: $urlget(id).Reply

;; HTTP/1.1 200 OK
echo -ag ReplyLine: $urlget(id).ReplyLine

;; HTTP/1.1
echo -ag VersionText: $urlget(id).VersionText

;; 1.1
echo -ag Version: $urlget(id).Version

;; 200
echo -ag StatusCode: $urlget(id).StatusCode

;; OK
echo -ag StatusText: $urlget(id).StatusText



Retrieving Header Information
I'm not sure what library you are using to perform the requests, but extracting header info can be tedious (and a tad slow) in mSL due to things like the line-length-limit and folded/multiline headers

I propose $urlget have native functionality to retrieve individual headers:

Code
;; Returns all headers (excluding the status line)
$urlget(id).Headers

;; Stores all headers (excluding the status line) in the specified bvar
;; if the bvar exists, its contents are overwrote
$urlget(id, &bvar).Headers

;; Returns the number of individual headers received
$urlget(id, 0).headers

;; Returns the Nth header received
$urlget(id, N).headers

;; Stores the Nth header received in a bvar
;; if the bvar exists its contents are overwrote
$urlget(id, N, &bvar).headers

;; Returns the number of 'name' headers received
$urlget(id, name, 0).headers

;; Returns the Nth 'name' header received
$urlget(id, name, N).headers

;; Stores the Nth 'name' header received in a bvar
;; If the bvar exists, its contents are overwrote
$urlget(id, Some-Header, 1, &bvar).headers

Last edited by FroggieDaFrog; 22/10/20 02:45 AM.

I am SReject
My Stuff