๐งHTTP
Improved version of the HTTP function
gpm.HTTP( table parameters ) -> Promise
This function will always return a promise.
This function uses the HTTPRequest structure but will ignore the failed
and success
keys, which are replaced here by promise.
Resolve Result
Reject Result
Rejection result is always a string.
Usage Example
local promise = gpm.HTTP( {
["url"] = "docs.pika-soft.ru"
} )
promise:Then( function( result )
print( result.code, #result.body )
end,
function( errorMessage )
print( "Failed!\n\t", errorMessage )
end )
-- 200 179175
-- 200 225167
Last updated
Was this helpful?