[MarkLogic Dev General] Wrong Content-Type when JSON on GET /v1/rest-apis/{name}

Florent Georges lists at fgeorges.org
Mon Sep 11 02:32:47 PDT 2017


Hi,

The GET /v1/rest-apis/{name} endpoint, as documented on the website at
https://docs.marklogic.com/REST/GET/v1/rest-apis/[name], does not return
the correct Content-Type in case of JSON.

In case of JSON it returns text/plain instead of application/json.  In case
of XML it returns the correct application/xml.

Complete repro:

> http -A digest -a usr:pwd :8002/v1/rest-apis/App-Services
Accept:application/json
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 157
Content-Type: text/plain; charset=UTF-8
Keep-Alive: timeout=5
Server: MarkLogic

{
    "database": "Documents",
    "error-format": "compatible",
    "group": "Default",
    "modules-database": "Modules",
    "name": "App-Services",
    "port": "8000",
    "xdbc-enabled": "true"
}

> http -A digest -a usr:pwd :8002/v1/rest-apis/App-Services
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 377
Content-Type: application/xml; charset=UTF-8
Keep-Alive: timeout=5
Server: MarkLogic

<rapi:rest-api xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:name>App-Services</rapi:name>
  <rapi:group>Default</rapi:group>
  <rapi:database>Documents</rapi:database>
  <rapi:modules-database>Modules</rapi:modules-database>
  <rapi:port>8000</rapi:port>
  <rapi:error-format>compatible</rapi:error-format>
  <rapi:xdbc-enabled>true</rapi:xdbc-enabled>
</rapi:rest-api>

HTH, regards,

-- 
Florent Georges
H2O Consulting
http://h2o.consulting/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20170911/de26d6bc/attachment.html 


More information about the General mailing list