View previous topic :: View next topic |
Author |
Message |
treyrees
Joined: 31 Mar 2020 Posts: 3
|
Posted: Tue Mar 31, 2020 10:18 am Post subject: HTTP request action: some verbs 2xx, others 401 |
|
|
I am trying to use an HTTP request in an action profile to update components on our Statuspage. The request Statuspage asks for looks like this:
PUT /v1/pages/{pageId}/components/{componentId} HTTP/1.1
Host: api.statuspage.io
Authorization: {apiKey}
Content-Type: application/json
{
"component": {
"status": "operational"
}
}
This request has only returned 401. However, it should not, because the same request with the same authorization returns 2xx when ran outside the network HostMonitor is running in (when ran by Postman, PowerShell script). In addition, HostMonitor can request GET and POST (again, same authorization) and receive a 2xx. I have found that it is PUT and DELETE requests that return 401. Both of these facts tell me it is not an authorization problem, but rather, some verbs are being filtered/blocked and some are not.
Any help with this issue would be appreciated. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12792 Location: USA
|
Posted: Tue Mar 31, 2020 11:23 am Post subject: |
|
|
HostMonitor version?
Regards
Alex |
|
Back to top |
|
|
treyrees
Joined: 31 Mar 2020 Posts: 3
|
Posted: Tue Mar 31, 2020 11:45 am Post subject: |
|
|
[quote="KS-Soft"]HostMonitor version?
Regards
Alex[/quote]
11.32. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12792 Location: USA
|
Posted: Tue Mar 31, 2020 11:48 am Post subject: |
|
|
Too old.
You need 11.96 or newer
Regards
Alex |
|
Back to top |
|
|
treyrees
Joined: 31 Mar 2020 Posts: 3
|
Posted: Tue Mar 31, 2020 11:57 am Post subject: |
|
|
[quote="KS-Soft"]Too old.
You need 11.96 or newer
Regards
Alex[/quote]
Would using a script that calls the Invoke-RestMethod cmdlet be a viable workaround?
Thank you. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12792 Location: USA
|
Posted: Tue Mar 31, 2020 1:11 pm Post subject: |
|
|
Yes, you may start external scripts using "Execute external program" action.
(external tests/actions uses more system resources but if you don't need to start this action 10 times/sec then its Ok)
Regards
Alex |
|
Back to top |
|
|
|