Garry's Mod Wiki

Revision Difference

Structures/HTTPRequest#516766

<cat>struct</cat> <structure>⤶ <description>Table used by <page>Global.HTTP</page> function.</description>⤶ <fields>⤶ {{StructureField|function|failed|Function to be called on failure. Arguments are⤶ * {{FuncArg|string|reason⤶ </fields>⤶ ⤶ </structure>⤶ ⤶ ⤶ {{Structure⤶ |Description=Table used by <page>Global.HTTP</page> function.|Fields={{StructureField|function|failed|Function to be called on failure. Arguments are⤶ * {{FuncArg|string|reason}}⤶ }}{{StructureField|function|success|Function to be called on success. Arguments are * {{FuncArg|number|code}} * {{FuncArg|string|body}} * {{FuncArg|table|headers}} }}{{StructureField|string|method|Request method, case insensitive. Possible values are: * GET * POST * HEAD * PUT * DELETE * PATCH * OPTIONS }}{{StructureField|string|url|The target url}}{{StructureField|table|parameters|KeyValue table for parameters. This is only applicable to the following request methods: * GET * POST * HEAD }}{{StructureField|table|headers|KeyValue table for headers}}{{StructureField|string|body|Body string for POST data. If set, will override parameters}}{{StructureField|string|type|Content type for body.|"text/plain; charset&#61;utf-8"}} }}