We tried to use citeproc-node via web requests made in C#, but were unable to deserialize the json results. Through some investigation, we found that our POST requests had their Expect headers set to '100-continue' by default. Since node.js and citeproc-node sent back 100-continue responses to this, the deserialization of the call ultimately failed.
Repro steps:
Start an instance of citeServer.js locally on port 8085.
curl -H "Content-type: application/json" -H "Expect: 100-continue" -X POST -d "{\"items\":[{\"type\":\"book\",\"author\":[{\"family\":\"Lichtheim\",\"given\":\"Miriam\"}],\"title\":\"Ancient Egyptian literature: volume II: the new kingdom\",\"issued\":{\"date-parts\":[[\"1973\"],[\"0\"]]},\"publisher-place\":\"Berkeley\",\"publisher\":\"University of California Press\"}]}" http://localhost:8085?style=apa
Expected: citeServer returns a bibliography object with the desired results.
Actual: the response from citeServer fails to return.
Also made a change to return a 400 when the requested citation style isn't in the /csl folder.
Another change adds a "forceLang" query parameter that allows a client to specify that, even if a csl format has a "default language" (i.e. din-1505-2), the language specified in the query should be used.
Another change makes sure to specify the charset as utf-8 in all of the Content-Type headers.
The problems here were due to differing nodejs versions. Master has now been updated to work on latest stable and most of these issues have been addressed.
Those not fully addressed:
Requests for styles we don't have return 404 rather than 400.
forceLang as implemented here doesn't take the setting into account for cached engines, and without looking at the citeproc.js code it's not clear to me if the engine can have this setting changed after construction without doing most of the work of construction over again anyway.
Node.js automatically responds with a 100-continue if the 'checkContinue' event isn't handled (http://nodejs.org/api/http.html#http_event_checkcontinue).
We tried to use citeproc-node via web requests made in C#, but were unable to deserialize the json results. Through some investigation, we found that our POST requests had their Expect headers set to '100-continue' by default. Since node.js and citeproc-node sent back 100-continue responses to this, the deserialization of the call ultimately failed.
Repro steps:
Run the following command via curl (http://curl.haxx.se/):