sym.sdk.integrations.dangerous.http

The HTTP Integration allows arbitrary HTTP requests to be made to remote servers.

The API is similar to that of the requests library.

Functions

delete(url[, body])

Makes a DELETE request to the given URL, with the specified body.

get(url)

Makes a GET request to the given URL.

patch(url[, body])

Makes a PATCH request to the given URL, with the specified body.

post(url[, body])

Makes a POST request to the given URL, with the specified body.

put(url[, body])

Makes a PUT request to the given URL, with the specified body.

request(url, method[, body])

Makes an HTTP request to the given URL with the specified method and body.

Classes

SymRequest

Wraps a URL that you might make a request to.

class sym.sdk.integrations.dangerous.http.SymRequest(url: str, session: Optional[requests.sessions.Session] = None)

Bases: object

Wraps a URL that you might make a request to.

Handles sharing a Session across a host.

go(method: Literal[GET, POST, PUT, PATCH, DELETE], data: Optional[Dict] = None, headers: Optional[Dict[str, str]] = None)requests.models.Response

Executes a request and caches the response.

with_path(path: str)

Returns a SymRequest with the specified sub-path

You can also use the / operator as a shortcut for this method.

sym.sdk.integrations.dangerous.http.delete(url: str, body: Optional[Dict] = None)Union[str, dict]

Makes a DELETE request to the given URL, with the specified body.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.

sym.sdk.integrations.dangerous.http.get(url: str)Union[str, dict]

Makes a GET request to the given URL.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.

sym.sdk.integrations.dangerous.http.patch(url: str, body: Optional[Dict] = None)Union[str, dict]

Makes a PATCH request to the given URL, with the specified body.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.

sym.sdk.integrations.dangerous.http.post(url: str, body: Optional[Dict] = None)Union[str, dict]

Makes a POST request to the given URL, with the specified body.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.

sym.sdk.integrations.dangerous.http.put(url: str, body: Optional[Dict] = None)Union[str, dict]

Makes a PUT request to the given URL, with the specified body.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.

sym.sdk.integrations.dangerous.http.request(url: str, method: Literal[GET, POST, PUT, PATCH, DELETE], body: Optional[Dict] = None)

Makes an HTTP request to the given URL with the specified method and body.

If the response is valid JSON, a dictionary is returned, otherwise, a string is returned.