Skip to main content

The http connector allows users to issue http(s) requests.

Tabset

Read​

Get data from a HTTP(S) endpoint.

Recipe​

read:
- http:
url: https://data.example.com
method: GET

Function​

from wrangles.connectors import http
df = http.read(
url='https://data.example.com',
method='GET'
)

Parameters​

ParameterRequiredData TypeNotes
url✓strThe URL to make the request to
methodstrThe http method to use (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS). Default GET.
headersobjHeaders to pass as part of the request
paramsobjPass URL encoded parameters
jsonobjPass data as a JSON encoded request body
json_keystrSelect sub-elements from the response JSON. Multiple levels can be specified with e.g. key1.key2.key3
columnslistSubset of columns to be returned
oauthobjMake a request to get an OAuth token prior to sending the main request.
orientstrThe format of the JSON to be converted to a dataframe. Default records.
order_bystrUses SQL syntax to sort the input.
ifstrA condition that will determine whether the action runs or not as a whole.

Write​

Write data to a HTTP(S) endpoint.

Recipe​

read:
- http:
url: https://data.example.com
method: POST

Function​

from wrangles.connectors import http
df = http.read(
url='https://data.example.com',
method='POST'
)

Parameters​

ParameterRequiredData TypeNotes
url✓strThe URL to make the request to
methodstrThe http method to use (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS). Default POST.
headersobjHeaders to pass as part of the request
orientstrThe format of the JSON to send. Default records.
batchboolIf True, send the entire DataFrame as a single request. If False, send each row as a separate request. If an integer, send the DataFrame in batches of that size.
oauthobjMake a request to get an OAuth token prior to sending the main request
ifstrA condition that will determine whether the action runs or not as a whole.