--- title: "system.net.httpPost" description: "Retrieves the document at the given URL using the HTTP POST protocol." --- # system.net.httpPost > Retrieves the document at the given URL using the HTTP POST protocol. This function is used in **Python Scripting**. ## Description Retrieves the document at the given URL using the HTTP POST protocol. If a parameter dictionary argument is specified, the entries in the dictionary will encoded in "application/x-www-form-urlencoded" format, and then posted. You can post arbitrary data as well, but you'll need to specify the MIME type. The document is then returned as a string. Keep in mind that [JRE proxy settings](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/doc-files/net-properties.html#Proxies) will influence how these functions conduct their network activities. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax - postParams Dictionary `system.net.httpPost(url, postParams)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String| `url` | The URL to post to. Dictionary[String, String]| `postParams` | A dictionary of name/value key pairs to use as the post data. ### Returns **String** - The content returned for the POST operation. ### Scope Gateway, Vision Client, Perspective Session ## Syntax - Alternative `system.net.httpPost(url, [contentType], [postData], [connectTimeout], [readTimeout], [username], [password], headerValues], [bypassCertValidation], [throwOnError])` ### Parameters Type | Parameter | Description ------- | ------- | ------ String| `url` | The URL to post to. String| `contentType` | The MIME type to use in the HTTP "Content-type" header. [optional] String| `postData` | The raw data to post via HTTP. [optional] Integer| `connectTimeout` | The timeout for connecting to the url. In milliseconds. Default is 10,000. [optional] Integer| `readTimeout` | The read timeout for the get operation. In milliseconds. Default is 60,000. [optional] String| `username` | If specified, the call will attempt to authenticate with basic HTTP authentication. [optional] String| `password` | The password used for basic http authentication, if the username parameter is also present. [optional] Dictionary[String, Integer]| `headerValues` | A dictionary of name/value pairs that will be set in the http header. [optional] Boolean| `bypassCertValidation` | If the target address is an HTTPS address, and this parameter is True, the system will bypass all SSL certificate validation. This is not recommended, though is sometimes necessary for self-signed certificates. [optional] Boolean| `throwOnError` | Set to false if you wish to get the error body rather than a Python exception if the POST request returns an error code (non-200 responsive). Default is True. [optional] ### Returns **String** - The content returned for the POST operation. ### Scope Gateway, Vision Client, Perspective Session If you are using JSON, check out the [system.util.jsonEncode](appendix/scripting-functions/system-util/system-util-jsonEncode.md) and [system.util.jsonDecode](appendix/scripting-functions/system-util/system-util-jsonDecode.md). ## Code Example ```python title="Code Snippet" # This code sends an XML message to a hypothetical URL. message = "here is the element" system.net.httpPost("http://www.posttome.xyz/posthere", "text/xml", message) ```