Hi,
I'm trying to use the http_poller input plug-in to recreate the curl statement below.
curl --user xps_client: --basic --data "username=admin&password=admin&scope=XPS_API_ALL&grant_type=password" http://xps.invigorinsights.com/oauth/token
My input configuration is as follows:
input {
http_poller {
urls => {
test => {
# Supports all options supported by ruby's Manticore HTTP client
method => post
url => "http://xps.invigorinsights.com/oauth/token"
user => "xps_client"
password => ""
headers => {
content-type => "application/x-www-form-urlencoded"
}
body => "username=admin&password=password&scope=XPS_API_ALL&grant_type=password"
}
}
request_timeout => 60
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
schedule => { every => "1d"}
codec => "json"
# A hash of request metadata info (timing, response headers, etc.) will be sent here
metadata_target => "http_poller_metadata"
}
}
I'm getting an error back from the request which suggests the body is not correctly formatted.
Can anyone see what I'm doing wrong?
Thanks,
Michael