1
Documentation and Translation / API: SMART Plugin docs specify POST requests to api, but no parameters specified
« on: April 22, 2021, 01:43:22 pm »
Hello Everyone,
this is my first post to this forum, and I hope I've picked the right area to do so.
I am a bit confused about the API docs of the SMART plugin (https://docs.opnsense.org/development/api/plugins/smart.html). The docs tell me that a POST request is required to query this part of the API, but there are no Parameters etc. specified that have to be POSTed.
I feel like the Docs are lacking some information how to properly query the SMART plugin API.
Thank you for your insights!
What I've tried:
I tried with GET at first, but this just brings up an error message:
When I do a POST, I don't even get json as return, just a HTTP 411 error:
I am testing with curl like the example from the how-tos (https://docs.opnsense.org/development/how-tos/api.html#using-curl):
GET:
this is my first post to this forum, and I hope I've picked the right area to do so.
I am a bit confused about the API docs of the SMART plugin (https://docs.opnsense.org/development/api/plugins/smart.html). The docs tell me that a POST request is required to query this part of the API, but there are no Parameters etc. specified that have to be POSTed.
I feel like the Docs are lacking some information how to properly query the SMART plugin API.
Thank you for your insights!
What I've tried:
I tried with GET at first, but this just brings up an error message:
Code: [Select]
{
"message": "Unable to run info action"
}
When I do a POST, I don't even get json as return, just a HTTP 411 error:
Code: [Select]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>411 Length Required</title>
</head>
<body>
<h1>411 Length Required</h1>
</body>
</html>
I am testing with curl like the example from the how-tos (https://docs.opnsense.org/development/how-tos/api.html#using-curl):
GET:
Code: [Select]
curl -k -u "<api_user>":"<api_pass>" https://<opnsense>/api/smart/service/list
POST: Code: [Select]
curl -XPOST -k -u "<api_user>":"<api_pass>" https://<opnsense>/api/smart/service/list