?- http_post('https://postman-echo.com/post/', json([test=aha]), Response, []).ERROR: Type error: ``json_term' expected, found ``test=aha' (a compound)...
Now my question: bug or feature?
If it's a bug, could it be fixed? Or am I doing this completely wrong?
I don't know whether this is a bug or a feature...
When I use http_post with json-data, I have to wrap the json-data two times with the json-marker-predicate 'json'. Working example:
?- http_post('https://postman-echo.com/post/', json(json([test=aha])), Response, []).
When don't double-wrap the json, it won't work:
?- http_post('https://postman-echo.com/post/', json([test=aha]), Response, []).
ERROR: Type error: ``json_term' expected, found ``test=aha' (a compound)
...
Now my question: bug or feature?
If it's a bug, could it be fixed? Or am I doing this completely wrong?
If it's a feature, could it be documented e.g. in http://www.swi-prolog.org/pldoc/doc_for?object=http_post/4 and/or in http://www.swi-prolog.org/pldoc/man?section=json - Or is it already documented and I just didn't find it?
Thank you very much!
Cheers, Ruedi