Open TheGha opened 1 year ago
with the string "{"action":"findNotes","version":6,"params":{"cards":"deck:current"}}"
"cards"
is not correct there. Should be "query"
.
thanks, tho it still does the same thing after changing it. console now shows:
json sent: {"action":"findNotes","version":6,"params":{"query":"deck:current"}}
response: AnkiConnect v.6
The response is what would be expected if the request doesn't actually include the JSON mentioned.
The code only prints what getCards contains; it doesn't prove that the expected JSON is actually being sent to AnkiConnect. Log what is actually going out, e.g. https://stackoverflow.com/questions/18924996/logging-request-response-messages-when-using-httpclient
oh using the LoggingHandler in response to the stack overflow link you sent i managed to figure out that what i did wrong was the post as json and such did not take a json as input, as they serialized it themselves. thanks a ton for your help!
Good deal. This issue should be closed then; not a bug in AnkiConnect.
Hi, i am trying to figure this out in C#, since that is the language i am the most used to by far. but this is the first time i am doing http, and jsons in this manner. to dumb it down to general coding concepts: i am posting to "http://localhost:8765" with the string "{"action":"findNotes","version":6,"params":{"cards":"deck:current"}}" and the response i am getting is "AnkiConnect v.6"
the relevant code lines are:
and
giving me this in the console: