atom feed2 messages in com.marklogic.developer.generalRe: [MarkLogic Dev General] Wrong Con...
FromSent OnAttachments
Florent GeorgesSep 11, 2017 2:32 am 
Charles GreerSep 12, 2017 11:02 am 
Subject:Re: [MarkLogic Dev General] Wrong Content-Type when JSON on GET /v1/rest-apis/{name}
From:Charles Greer (Char@marklogic.com)
Date:Sep 12, 2017 11:02:13 am
List:com.marklogic.developer.general

Hi Florent, thanks much for reporting the issue. I've made an issue for it in
our bug tracking system.

Charles

Charles Greer Lead Engineer MarkLogic Corporation cgr@marklogic.com Cell: +1 707 318 0442 @grechaw www.marklogic.com

________________________________ From: gene@developer.marklogic.com
[gene@developer.marklogic.com] on behalf of Florent Georges
[lis@fgeorges.org] Sent: Monday, September 11, 2017 2:32 AM To: MarkLogic Developer Discussion Subject: [MarkLogic Dev General] Wrong Content-Type when JSON on GET
/v1/rest-apis/{name}

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,