Garry's Mod Wiki

http

The http library allows either the server or client to communicate with external websites via HTTP, both GET (http.Fetch) and POST (http.Post) are supported. A more powerful & advanced method can be used via the global HTTP function.

Methods

http.Fetch( string url, function onSuccess = nil, function onFailure = nil, table headers = {} )
Launches a GET request. HTTP-requests on private networks don't work. To enable HTTP-requests on private networks use Command Line Parameters -allowlocalhttp
http.Post( string url, table parameters, function onSuccess = nil, function onFailure = nil, table headers = {} )
Sends an asynchronous POST request to a HTTP server. HTTP requests returning a status code >= 400 are still considered a success and will call the onSuccess callback. The onFailure callback is usually only called on DNS or TCP errors (e.g. the website is unavailable or the domain does not exist) HTTP-requests on private networks don't work. To enable HTTP-requests on private networks use Command Line Parameters -allowlocalhttp

Page Links


Special Pages


Wikis

?

Render Time: 45ms

Session 0
DB GetPage 6
Generate Html 11
SaveChanges 13
Render Body 0
Render Sidebar 12