File size: 5,245 Bytes
d7bb13e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
1.34 HttpPostData .263
1.34.1 HttpPostData.AddDataHeader .263
1.34.2 HttpPostData.AddHttpHeader .263
1.34.3 HttpPostData.AddValue .264
1.34.4 HttpPostData.Create .265
1.34.5 HttpPostData.Finalize .265
1.34.6 HttpPostData.FinalizeData .266
1.34.7 HttpPostData.FinalizeHttpHeaders .266
1.34.8 HttpPostData.Reset .267

HttpPostData
HttpPostData.AddDataHeader
Brief
Adds a data header to the post data.
Definition
boolean HttpPostData.AddDataHeader( HttpPostData postData, string key, string mimeType = nil, string
filename )
Arguments
PostData - The instance of the post data.key - The name of the value to be added to the post data.mimeType - Optional. The mime type of the
data to add to the post data (e.g. "text/xml").filename - Optional. A file name to set for the data. May be needed for the Webserver to see the data
as a file
Return Values
True if the header was added.
Description
Adds a data header to the post data. This assumes the the script will add the actual data directly in some other way such as writing an XML file
into the container. The data must be finalized using FinalizeData before any new values can be added to the post data.
Examples
success = HttpPostData.AddDataHeader( postData, "file", "text/xml" )
See Also
FlttpPostData. FinalizeData
HttpPostData.AddHttpHeader
Brief
Adds an http header key value pair.
Definition
HttpPostData.AddHttpHeader( HttpPostData postData, string key, boolean|number|string|nil value )
Arguments
PostData - The instance of the post data.key - The name of the value to be added to the header.value - A boolean/number/string/nil to use as the
value to add to the header.
Return Values
Description
Adds a value to the http header. The function will error if there is not enough space in the container to add the value. Headers must be added
before adding of any data, signify the of the header section by calling HttpPostData.FinalizeHttpHeaders.
Examples
container = MemoryContainer.Create ( 4096 )
postdata = HttpPostData.Create( container, "multipart/form-data" )
postdata:AddHttpHeader( "keyl", "valuel" )
postdata:AddHttpHeader( "key2", "value2" )
postdata:AddHttpHeader( "key3", "value3" )
postdata:FinalizeHttpHeaders()
postdata:AddValue( "name", "Bob" )
postdata:AddValue( "password", "abcl23" )
postdata:Finalize()
See Also
HttpPostData. AddValue
Brief
Adds a value to the post data.
Definition
boolean HttpPostData.AddValue( HttpPostData postData, string key, variant value )
Arguments
PostData - The instance of the post data.key - The name of the value to be added to the post data.value - A boolean/number/string to use as the
value to add to the post data.
Return Values
True if the value was added.
Description
Adds a value to the post data. The function will return false if there is not enough space in the container to add the value.
Examples
| success = HttpPostData.AddValue( postData, "name", "Bob" )
See Also
None
HttpPostData.Create
Brief
Creates a new HttpPostData object.
Definition
HttpPostData.Create( MemoryContainer container, string contentType )
Arguments
container - The memory container to write the post data to.contentType - The encoding used for the post data. Specify either
"application/x-www-form-urlencoded" or "multipart/form-data".
Return Values
HttpPostData - A new instance of post data.
Description
Creates a new HttpPostData object. The memory container used will be reset so an data held in it will be lost.
Examples
container = MemoryContainer.Create( 4096 )
PostData = HttpPostData.Create( container )
See Also
HttpPostData.Finalize
Brief
Finalizes the post data.
Definition
boolean HttpPostData.Finalize( HttpPostData postData )
Arguments
postData - The instance of the post data.
Return Values
True if the post data was finalized.
Description
Finalizes the post data so that it can be sent up to a server. No new data can be added after this call.
Examples
! success = HttpPostData.Finalize( postData )
See Also
� FlttpPostData.AddDataFleader
HttpPostData.FinalizeData
Brief
Finalizes any data that has been added after calling AddDataFleader.
Definition
j boolean HttpPostData.FinalizeData( HttpPostData postData )
Arguments
postData - The instance of the post data.
Return Values
True if the data value was finalized.
Description
Finalizes any data that has been added after calling AddDataFleader so that new data values can be added to the post data.
Examples
| success = HttpPostData.FinalizeData ( postData )
See Also
� FlttpPostData.AddDataFleader
HttpPostData.FinalizeHttpHeaders
Brief
Finalizes the header section after calling AddFIttpFleader.
Definition
HttpPostData.FinalizeHttpHeaders( HttpPostData postData )
Arguments
PostData - The instance of the post data.
Return Values
Description
Finalizes the header section after calling AddHttpHeader. No further headers can be added after calling this function.
Examples
I HttpPostData.FinalizeHttpHeaders( postData )
See Also
� HttpPostData.AddHttpHeader
HttpPostData. Reset
Brief
Resets the post data.
Definition
j HttpPostData.Reset( HttpPostData postData )
Arguments
postData - The instance of the post data.
Return Values
None.
Description
Resets the post data so that a new request can be created using the same object.
Examples
! HttpPostData.Reset( postData )
See Also
None