POST to /api/scripts/direct does not work. #1943
Labels
bug
Something likely wrong in the code
importance: medium
A bit annoying, minor miscalculation, but no crash
state: confirmed
A developer can reproduce the issue
Milestone
Expected Behaviour
I'm trying to send command to Stellarium via the RemoteContol plugin from a .NET application, using "ScriptService operations (/api/scripts/)" POST direct operation.
The command I'm using to try this is "core.quitStellarium();" (just to have a simple command without any parameter).
I'm expeting Stellarium to execute the command and quit (or do whatever else I put in the command).
Actual Behaviour
Nothing happens, the command seems to be ignored.
Most interesting thing (and probably really relevant) I find the following lines in the Stellarium\Log.txt everytime I try to POST to /api/scripts/direct
QMetaObject::invokeMethod: No such method StelScriptMgr::runScriptDirect(QString,QString)
Candidates are:
runScriptDirect(QString,QString,int&,QString)
runScriptDirect(QString,QString,int&)
This is the HTTP Post data, captured with Wireshark:
0000 50 4f 53 54 20 2f 61 70 69 2f 73 63 72 69 70 74 - POST /api/script
0010 73 2f 64 69 72 65 63 74 20 48 54 54 50 2f 31 2e - s/direct HTTP/1.
0020 31 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a - 1..Content-Type:
0030 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 - application/x-w
0040 77 77 2d 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 - ww-form-urlencod
0050 65 64 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 36 - ed..Host: 192.16
0060 38 2e 34 2e 31 33 3a 38 30 39 30 0d 0a 43 6f 6e - 8.4.13:8090..Con
0070 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 33 33 0d - tent-Length: 33.
0080 0a 45 78 70 65 63 74 3a 20 31 30 30 2d 63 6f 6e - .Expect: 100-con
0090 74 69 6e 75 65 0d 0a 43 6f 6e 6e 65 63 74 69 6f - tinue..Connectio
00a0 6e 3a 20 4b 65 65 70 2d 41 6c 69 76 65 0d 0a 0d - n: Keep-Alive...
00b0 0a 63 6f 64 65 3d 63 6f 72 65 2e 71 75 69 74 53 - .code=core.quitS
00c0 74 65 6c 6c 61 72 69 75 6d 25 32 38 25 32 39 25 - tellarium%28%29%
00d0 33 42 .. .. .. .. .. .. .. .. .. .. .. .. .. .. - 3B
This packet is created & sent by the HttpClient .NET class which works fine for all other commands.
It seems ok to me.
At the moment, I've worked around this problem by writing the command to a temporary script (.ssc) and running the script.
System
The text was updated successfully, but these errors were encountered: