atom feed12 messages in com.marklogic.developer.generalRe: [MarkLogic Dev General] How to ge...
FromSent OnAttachments
spigSep 30, 2010 3:53 pm 
Danny SokolskySep 30, 2010 4:06 pm 
Nuno JobSep 30, 2010 4:07 pm 
Lee, DavidSep 30, 2010 4:14 pm 
Tim MeagherSep 30, 2010 4:27 pm 
Lee, DavidSep 30, 2010 4:50 pm 
spigOct 1, 2010 7:15 am 
Florent GeorgesOct 1, 2010 7:25 am 
Geert JostenOct 4, 2010 11:40 pm 
McBeath, Darin W (ELS-STL)Oct 5, 2010 4:50 am 
Shah, Mehul (LNG-NPV)Oct 5, 2010 8:41 am 
Shah, Mehul (LNG-NPV)Oct 6, 2010 10:16 am 
Subject:Re: [MarkLogic Dev General] How to get request headersforxdmp:http-get request
From:Lee, David (
Date:Sep 30, 2010 4:50:24 pm

FYI, this one line xmlsh command ( will setup an http server running on port 80 which will echo all the request headers back to the caller.

httpserver -get 'xecho $HTTP_HEADERS' start

Example output by hitting http://localhost from Chrome


<header name="Host">



<header name="Accept-encoding">

<value>gzip, deflate</value>


<header name="Connection">



<header name="Accept-language">



<header name="User-agent">

<value>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C)</value>


<header name="Accept">




From: [] On Behalf Of Tim Meagher Sent: Thursday, September 30, 2010 7:28 PM To: 'General Mark Logic Developer Discussion' Subject: Re: [MarkLogic Dev General] How to get request headersforxdmp:http-get request

I used this for viewing requests and headers - you can cater it to your own needs.

xquery version "1.0-ml"; let $request-body := xdmp:get-request-body("xml") let $request := if ($request-body) then $request-body else xdmp:get-request-field("request") return ( xdmp:set-response-content-type("application/xml"), element back {( element request-header-names {xdmp:get-request-header-names()}, element request-headers { for $header in xdmp:get-request-header-names() return element header { element header-name {$header}, element header-val {xdmp:get-request-header($header)} } }, element request-body {$request} )} )

Does that help at all?

Tim Meagher


From: [] On Behalf Of spig Sent: Thursday, September 30, 2010 6:54 PM To: Subject: [MarkLogic Dev General] How to get request headers forxdmp:http-get request

Is there a way to see what request headers are being sent by xdmp:http-get requests?