adamfowleruk / mljs

MarkLogic REST API JavaScript wrapper for NodeJS and Browser Apps
http://adamfowleruk.github.io/mljs/apidocs/core/tutorial-all.html
Other
33 stars 19 forks source link

Content-Type doesn't seem to work for me #32

Closed spig closed 11 years ago

spig commented 11 years ago

I noticed that all my responses are coming back as XML from the database. The line in the __doreq function replaces format=json with Content-Type of application/json. My server only works with format=json - any ideas?

This is only for GET requests that I've tested.

I'm running Marklogic version 6.0-2.3

spig commented 11 years ago

I've put in a fix for this problem as well as another problem I found with version 0.10 of nodejs. The streamReadable class changed in 0.10 and now requires a person to read the content returned, or to listen to the 'data' event and that will set the streamReadable into "old mode". I'm not sure if you're trying to stay up-to-date with nodejs or not but I've also moved my fork to the ~0.10.x engine in the package.json.

adamfowleruk commented 11 years ago

I originally just created MLDB for JSON usage. I've recently had to add in support for XML generally on the browser wrapper side. Glad you've found this for the node js side.

I'll look at doing similar for the node js side soon to what you have done. Thanks for taking a look.

adamfowleruk commented 11 years ago

It should be noted that in various places it is either Content-Type or Content-type. MarkLogic server expects a lowercase t: Content-type.