HTTPRequestData["prop"]
gives the value of the specified property of the current HTTP request.
gives an association with values of properties of the current HTTP request.
HTTPRequestData
HTTPRequestData["prop"]
gives the value of the specified property of the current HTTP request.
gives an association with values of properties of the current HTTP request.
Details
- The properties available through HTTPRequestData depend on the evaluation environment being used, as determined by $EvaluationEnvironment.
- HTTPRequestData["Properties"] gives a list of properties available in any particular case.
- In web-based environments, the following are typically available:
-
"Scheme" URL scheme (appearing at the beginning) "Domain" domain name or host "Port" port number (appearing after :) "Path" path list (separated by /) "PathString" complete path as a string "AbsolutePath" complete path as a string, including domain and scheme "DispatchPathString" element of path used in URLDispatcher processing "Query" list of parameter-value pairs (appearing after ?) "QueryString" complete query string "Method" typical values include "GET", "PUT", and "POST" "Headers" fields of the request header "Body" raw body of the request as a string "BodyByteArray" raw body of the request as a ByteArray object "BodyBytes" raw body of the request as a list of byte values "MultipartElements" list of multipart elements "FormRules" rules for all form elements in the request
Examples
open all close allBasic Examples (1)
Scope (4)
Deploy a delayed expression that gives the query parameters as a list of rules:
obj = CloudDeploy[Delayed[HTTPRequestData["Query"], "WL"]]Request the delayed expression and pass query parameters:
URLRead[
URLBuild[obj, <|"name" -> "Socrates", "country" -> "Greece"|>],
"Body"
]Deploy a delayed expression that gives multiple request data properties:
obj = CloudDeploy[Delayed[HTTPRequestData[{"Method", "Query", "FormRules"}], "WL"]]Request the delayed expression using the POST method:
URLRead[
HTTPRequest[obj, <|"Body" -> <|"name" -> "Socrates", "country" -> "Greece"|>|>],
"Body"
]Deploy a delayed expression that manually checks that query parameters are all numbers:
obj = CloudDeploy[Delayed[Interpreter["Number"][HTTPRequestData["Query"][[All, 2]]], "WL"]]URLExecute[obj, <|"x" -> "2", "s" -> "a"|>]Implement your own version of APIFunction:
apifunction[form_, func_] := Delayed[With[{values = Setting[form[HTTPRequestData["Query"]]]}, If[FreeQ[values, Failure], func[values], $Failed]], "WL"];api = CloudDeploy[apifunction[FormObject["x" -> "Integer"], #x!&]]URLExecute[api, <|"x" -> "24"|>]Text
Wolfram Research (2014), HTTPRequestData, Wolfram Language function, https://reference.wolfram.com/language/ref/HTTPRequestData.html (updated 2016).
CMS
Wolfram Language. 2014. "HTTPRequestData." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/HTTPRequestData.html.
APA
Wolfram Language. (2014). HTTPRequestData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HTTPRequestData.html
BibTeX
@misc{reference.wolfram_2026_httprequestdata, author="Wolfram Research", title="{HTTPRequestData}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/HTTPRequestData.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_httprequestdata, organization={Wolfram Research}, title={HTTPRequestData}, year={2016}, url={https://reference.wolfram.com/language/ref/HTTPRequestData.html}, note=[Accessed: 12-June-2026]}