url encode: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server | {{Info|Function|Server|1.0.3}} | ||
{{FuncDescription|Encodes your string so it is safe to send with an URL.}} | {{FuncDescription|Encodes your string so it is safe to send with an URL.}} | ||
Line 22: | Line 22: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{HttpFunctions}} |
Latest revision as of 21:44, 19 January 2020
Description
Encodes your string so it is safe to send with an URL.
Syntax
url_encode(str)
Parameters
- str
The string to encode.
Return Value
- Returns the encoded string.
Example
local body = ""
body = body.."foo1="..url_encode("bar?")
body = body.."foo2="..url_encode("?d,_:%bar2?")
http_set_body(r, body)
http_set_field(r, "content-length", string.len(body))
http_set_field(r, "content-type", "application/x-www-form-urlencoded; charset=utf-8")
See also
- url_encode
- http_count
- http_get_all
- http_is_valid
- http_create
- http_destroy
- http_is_error
- http_result_error
- http_result_body
- http_result_header
- http_result_status
- http_set_protocol
- http_set_resolver_protocol
- http_set_host
- http_set_port
- http_set_target
- http_set_verb
- http_set_timeout
- http_set_verifymode
- http_set_version
- http_set_keepalive
- http_set_field
- http_set_body
- http_send