The WixHttpFunctionRequest
object breaks the URL of the incoming call to an HTTP
function into different parameters for easy access.
The URL of the incoming call to an HTTP function is broken into:
For premium sites, the URL of the incoming call has the following format:
https://www.domain.com/_functions/myFunction/sub?q=value
https://www.domain.com/_functions
sub
q=value
For free sites, the URL of the incoming call has the following format:
https://user_name.wixsite.com/mysite/_functions/myFunction/sub?q=value
https://user_name.wixsite.com/mysite/_functions
sub
q=value
Returns the base URL of a call to an HTTP function.
Premium sites:
Free sites:
Returns an object representing the body of the incoming call to an HTTP function.
Use the functions of the returned WixHttpFunctionRequestBody
object to get the body in a number of formats.
The request body can be a maximum of 512kb.
Returns the function name of a call to an HTTP function.
Premium sites:
Free sites:
Returns the HTTP header fields used in a call to an HTTP function.
The headers
property returns an object of key:value
pairs where the key
is the header field name and the value
is the header field value.
Headers are returned in lowercase, regardless of how they were sent by the function caller.
Returns the IP address of the client who called the HTTP function.
Returns the HTTP method used in calling an HTTP function.
Returns "GET"
, "POST"
, "PUT"
, or "DELETE"
.
// In http-functions.js
export function use_myFunction(request) {
let method = request.method; // "GET"
}