-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathhttpWrite.yaml
More file actions
42 lines (40 loc) · 1.75 KB
/
httpWrite.yaml
File metadata and controls
42 lines (40 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Scraped from: https://wiki.multitheftauto.com/wiki/HttpWrite
shared:
name: httpWrite
description: This function adds text to the output of the current HTTP file of the
[HTTP interface](/wiki/Resource_Web_Access "Resource Web Access"). The function
can only be used on parsed (i.e not marked as *raw*) HTTP pages. httpWrite can
support outputing binary data, if you specify the length of the data you are outtputing.
If you do this, you should ensure you set an accurate content\-type using [httpSetResponseHeader](/wiki/HttpSetResponseHeader
"HttpSetResponseHeader") otherwise it may be displayed inconsistently by browsers.
parameters:
- name: data
type: string
description: the data to be added to the page's output.
- name: length
type: int
description: The length of the data being written. Generally only should be required
for writing binary data.
examples:
- path: examples/httpWrite-1.lua
description: Example 1:This sample resource page will output a random quote from
a player using a function previously exported to http from a Lua script in the
resource.
side: server
- path: examples/httpWrite-2.lua
description: Example 2:Using httpWrite to return a file read in withfileRead.
This is useful as the internal server doesn't not support subdirectories reliably
so you can create a page to return files to you.
side: server
returns:
values:
- type: bool
name: value
description: Returns true if the text was added to the output buffer successfully,
false otherwise.
meta:
- needs_checking: 'This function was partially migrated from the old wiki. Please
review manually:
- Missing section: Shortcut syntax
'
requires_review: true