Scol standard library package
0.3.1
Common and usefull functions for all Scol applications
|
Functions | |
std_netBuildListFromParams (szParams) | |
Function to convert a string parameters like a=b&c=d ... to a list key,value. The given string should be already parsed (the params only). More... | |
std_netCheckConnection (szUrl, cbfun) | |
Check if a server can be joined. More... | |
std_netGetBody (szReq) | |
Return the body of a received request object. More... | |
std_netGetDomain (url) | |
Return the domain (or the IP address if any) in an url. More... | |
std_netGetHeader (szReq) | |
Return the header of a received request object. More... | |
std_netGetParamsInUrl (szUrl) | |
Return the params of a received GET request string. More... | |
std_netParseRequest (szReq) | |
Parse a received request. More... | |
Package to load : lib/std/net.pkg
Dependancies :
std_netGetDomain | ( | url | ) |
Return the domain (or the IP address if any) in an url.
"http://www.example.com:1234/dir/file.html" -> "www.example.com"
"http://www.example.com/dir/file.html" -> "www.example.com"
"http://1.2.3.4:1234/dir/file.html" -> "1.2.3.4"
Prototype : fun [S] S
S | : an url |
std_netParseRequest | ( | szReq | ) |
Parse a received request.
Prototype :fun [S] [S S S S S S S S S S [[S S] r1]]
S | : a string received request |
std_netGetHeader | ( | szReq | ) |
Return the header of a received request object.
Prototype :fun [S] S
S | : a valid request string |
std_netGetBody | ( | szReq | ) |
Return the body of a received request object.
Prototype :fun [S] S
S | : a valid request string |
std_netBuildListFromParams | ( | szParams | ) |
Function to convert a string parameters like a=b&c=d ... to a list key,value. The given string should be already parsed (the params only).
Prototype :fun [S] [[S S] r1]
S | : an already parsed string, typically from an url (GET) or a body (POST) |
"param1=a¶m2=b" -> [["param1" "a"] :: ["param2" "b"] :: nil
std_netGetParamsInUrl | ( | szUrl | ) |
Return the params of a received GET request string.
"http://domain.tld/dir/file.ext?param1=a¶m2=b" -> "param1=a¶m2=b"
Prototype :fun [S] S
S | : a valid request string |
std_netCheckConnection | ( | szUrl | , |
cbfun | |||
) |
Check if a server can be joined.
Prototype :fun [S fun [I] I] I
S | : an url to check |
fun | [I] I : a function to call when the connection is checked. Its argument will be 1 if success. |