Garry's Mod Wiki

Revision Difference

Structures/HTTPRequest#516983

<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⤶ * <page>string</page> reason⤶ </fields> </structure> ⤶ ⤶ }}{{StructureField|function|success|Function to be called on success. Arguments are⤶ * {{FuncArg|number|code}}⤶ * {{FuncArg|string|body}}⤶ * {{FuncArg|table|headers}}⤶ ⤶ {{StructureField|function|success|Function to be called on success. Arguments are⤶ * <page>number</page> code⤶ * <page>string</page> body⤶ * <page>table</page> 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"}} }}