hi benjamin
I've looked at the log files and the api is being redirected from a POST -> GET by apache for some reason (I have no redirect in place as far as i know)
the console log shows an initial POST that gets a 301 redirect to GET (last two lines on the web server log)
very confused why this is happening, but I now have something to go on.
I ran a curl commandline which gets processed as a POST quite happily!
curl –data '{"jsonrpc":"2.0","method":"idoit.version","params":{"apikey":"<redacted>"} }' --header "Content-Type: application/json" http://<redacted>/i-doit/?api=jsonrpc
output:
{"jsonrpc":"2.0","result":{"login":{"userid":"22","name":"Api System","mail":"","username":"systemapi","mandator":"<redacted>","language":"en"},"version":"1.8.3","step":"","type":"OPEN"},"id":null}
weblog:
<redacted ip="">- - [05/Apr/2017:18:46:00 +0100] "POST /i-doit/?api=jsonrpc HTTP/1.1" 200 192 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
–
--- API log --->
i-doit 1.8.3 OPEN
host URL <redacted># log for "api"
started at 2017-04-05T19:38:54+02:00
written to "/var/www/html/i-doit/log/api_2017-04-05_19_38_54.log"
[2017-04-05 19:38:54 0.73788400] ERROR: This is not a JSON-RPC. The content-type should be application/json, request method should be "post" and the http body should be a valid json-rpc 2.0 package.
[2017-04-05 19:38:54 0.73793300] INFO: SERVER: array (
'HTTP_ACCEPT' => 'application/json, text/javascript, /; q=0.01',
'HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest',
'HTTP_REFERER' => 'http://<redacted>/Ticket/Create.html?Queue=1',
'HTTP_ACCEPT_LANGUAGE' => 'en-GB,en;q=0.5',
'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393',
'HTTP_HOST' => '<redacted>',
'HTTP_CONNECTION' => 'Keep-Alive',
'HTTP_COOKIE' => 'ga=GA1.3.2040217694.1457960180; RT_SID<redacted>.443=98fbb15673405e32a354012dc9262271; RT_SID_<redacted>.80=5e5b38d75b79b8948a6cd9dcaf75e278; PHPSESSID=0aae7200134b744eb7157dae37f47410',
'PATH' => '/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin',
'SERVER_SIGNATURE' => '
<address>Apache/2.2.15 (CentOS) Server at <redacted>Port 80</redacted></address>
',
'SERVER_SOFTWARE' => 'Apache/2.2.15 (CentOS)',
'SERVER_NAME' => '<redacted>',
'SERVER_ADDR' => '<redacted ip="">',
'SERVER_PORT' => '80',
'REMOTE_ADDR' => '<redacted ip="">',
'DOCUMENT_ROOT' => '/var/www/html',
'SERVER_ADMIN' => 'r.ruddock@qub.ac.uk',
'SCRIPT_FILENAME' => '/var/www/html/i-doit/index.php',
'REMOTE_PORT' => '9826',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => 'api=jsonrpc',
'REQUEST_URI' => '/i-doit/?api=jsonrpc',
'SCRIPT_NAME' => '/i-doit/index.php',
'PHP_SELF' => '/i-doit/index.php',
'REQUEST_TIME_FLOAT' => 1491413934.675,
'REQUEST_TIME' => 1491413934,
)
[2017-04-05 19:38:54 0.73794600] INFO: Transmitting response: {"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid request","data":{"error":"This is not a JSON-RPC. The content-type should be application/json, request method should be "post" and the http body should be a valid json-rpc 2.0 package."}},"id":0}
[2017-04-05 19:38:54 0.73795400] INFO: Batch-Request transmitted.
–- web log -->
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /NoAuth/Helpers/CustomLogo/1a23ce73b6081be99cecbb6fe8da2194 HTTP/1.1" 200 14641 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/images/ui-anim_basic_16x16.gif HTTP/1.1" 200 1553 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/css/images/shadow.png HTTP/1.1" 200 1698 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/images/i-doit.png HTTP/1.1" 200 10677 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/css/images/arrows-grey.png HTTP/1.1" 200 256 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/css/images/background-gradient.png HTTP/1.1" 200 394 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /static/images/css/rollup-arrow.gif HTTP/1.1" 200 97 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /NoAuth/js/jquery.dataTables.min.js HTTP/1.1" 200 77499 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /NoAuth/js/chosen.jquery.min.js HTTP/1.1" 200 26966 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /NoAuth/js/referenceidoitobjects.js HTTP/1.1" 200 41349 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "POST /i-doit?api=jsonrpc HTTP/1.1" 301 343 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
<redacted ip="">- - [05/Apr/2017:18:38:54 +0100] "GET /i-doit/?api=jsonrpc HTTP/1.1" 200 257 "http://<redacted>/Ticket/Create.html?Queue=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
–- debugger output --->
Name Protocol Method Result Content type Received Time Initiator
http://<redacted>/i-doit?api=jsonrpc HTTP POST 301 text/html 343 B 10.57 ms XMLHttpRequest
http://<redacted>/i-doit/?api=jsonrpc HTTP GET 200 application/json 257 B 166.84 ms XMLHttpRequest
any ideas as I am stumped at the moment? I will investigate the rewrite at my end toi see if anything 'funny' is happening.
thanks
Richard</redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted></redacted>