Table of Contents | |
---|---|
|
...
|
...
|
...
|
...
|
Using commandline requires curl to submit http requests to the API.
...
and can be removed after successful operation by
rm -v cfile
This gets basic information about an item.
...
Basically a POST
was already done by token creation. For most purposes POST
appears to be of minor importance.
...
json
, re
, itertools
, and datetime
are built-in moduls and do not need to be installed separately.
The carried body contains the authentification credentials as a dict
element. The auth cookie is then extracted (theToken
) from the response of the POST
request (see http requests).
import requests
import json
auth = requests.post('https://sandbox.sensor.awi.de/rest/sensors/contacts/login'
, data = {'username': <yourUserName>, 'authPassword': <yourSecretPassword>}
)
theToken = auth.cookies['x-auth-token']
This gets basic information about an item. The result is a dictionary object.
...
Basically a POST
was already done by token creation. For most purposes POST
appears to be of minor importance.
install.packages(c('httr', 'lubridate', 'jsonlite', 'stringr'), dep = TRUE)
The carried body contains the authentification credentials as a list element. The auth cookie is then extracted (theToken
) from the response of the POST
request (see http requests).
library('httr')
x <- POST(url = 'https://sandbox.sensor.awi.de/rest/sensors/contacts/login'
, body = list("username" = '<yourUserName>', "authPassword" = 'yourSecretPassword')
, encode = "form"
)
theToken <- x$cookies$value[2]
This gets basic information about an item. The result is a list object.
...