Skip to content

← network package

WebRequest

Perform a web request and retrieve the response.

This node performs an HTTP request to the given URL, using the specified method and optionally URL parameters. One may specify the request body as a dictionary or a string, and request headers and cookies. The response can be retrieved in the form of the data, status code, text, cookies, and headers outputs. To use basic authentication, one may pass a list of [username, password] to the 'auth' input; for digest authentication, one may instead pass a dictionary with the keys 'type', 'username', and 'password'. Version 0.5.0

Ports/Properties

data

Request/response data dictionary.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: dict (can be None)
  • data direction: INOUT

text

Request/response text.

  • verbose name: Text
  • default value: None
  • port type: DataPort
  • value type: str (can be None)
  • data direction: INOUT

cookies

Request/response cookies.

  • verbose name: Cookies
  • default value: None
  • port type: DataPort
  • value type: dict (can be None)
  • data direction: INOUT

headers

Request/response headers.

  • verbose name: Headers
  • default value: None
  • port type: DataPort
  • value type: dict (can be None)
  • data direction: INOUT

auth

Request authentication.

  • verbose name: Auth
  • default value: None
  • port type: DataPort
  • value type: object (can be None)
  • data direction: IN

status_code

Response status code.

  • verbose name: Status Code
  • default value: None
  • port type: DataPort
  • value type: int (can be None)
  • data direction: OUT

succeeded

Whether the request suceeded.

  • verbose name: Succeeded
  • default value: None
  • port type: DataPort
  • value type: bool (can be None)
  • data direction: OUT

session

Optional session object to use for the request.

  • verbose name: Session
  • default value: None
  • port type: DataPort
  • value type: BaseNode (can be None)
  • data direction: IN

method

HTTP method (verb) to use. Typically, GET is used for retrieval, POST for submission, and PUT for replacement of a record. DELETE is used to remove a resource. The other methods are less common and are used for specific purposes.

  • verbose name: Http Verb
  • default value: GET
  • port type: EnumPort
  • value type: str (can be None)

uri

URL to request.

  • verbose name: Url
  • default value: None
  • port type: StringPort
  • value type: str (can be None)

url_params

Optional URL parameters. This can also be wired in as a dictionary, or may be specified as in {'param1': value1, 'param2': value2}.

  • verbose name: Url Parameters
  • default value: None
  • port type: DictPort
  • value type: dict (can be None)

timeout

Request timeout in seconds. This can also be set to None, in which case it will default to infinite (this is, however, not recommended).

  • verbose name: Timeout
  • default value: 15.0
  • port type: FloatPort
  • value type: float (can be None)

raise_for_status

Raise an exception if the request fails. If this is set, the node will block until the request completes or times out. If it is not set, the node will only block when the response is accessed.

  • verbose name: Error On Failure
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

allow_redirects

Allow redirects.

  • verbose name: Allow Redirects
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

verify_ssl

Verify SSL certificate.

  • verbose name: Verify Ssl
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

extra_options

Additional options to pass to the underlying requests function (dictionary).

  • verbose name: Extra Options
  • default value: None
  • port type: DictPort
  • value type: dict (can be None)

verbose

Enable verbose diagnostics output.

  • verbose name: Verbose
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)