-
Notifications
You must be signed in to change notification settings - Fork 181
http
Sébastien Lucas edited this page Dec 2, 2015
·
3 revisions
The http service allows GET and POST requests to an HTTP service.
Each target has five parameters:
- The HTTP method (one of
getorpost) - The URL, which is transformed if possible (transformation errors are ignored)
-
Noneor a dict of parameters. Each individual parameter value is transformed. -
Noneor a list of username/password e.g.( 'username', 'password') -
Noneor True to force the transformation of the third parameter to a json object
[config:http]
timeout = 60
targets = {
#method #URL # query params or None # list auth #Json
'get1' : [ "get", "http://example.org?", { 'q': '{name}', 'isod' : '{_dtiso}', 'xx': 'yy' }, ('username', 'password') ],
'post1 : [ "post", "http://example.net", { 'q': '{name}', 'isod' : '{_dtiso}', 'xx': 'yy' }, None, True ]
}Note that transforms in parameters must be quoted strings:
- Wrong:
'q' : {name} - Correct:
'q' : '{name}'