Hi all,

I usually use TcpTunnel for this, but you could also temporarily change the 
target uri to point back to some test url within your MarkLogic app server and 
have that dump out all the information it is receiving. Tim's code will help 
you there. That way you won't need to rely on external tools.

You can add custom headers to your call, but there is no logic that enables you 
to inspect the headers supplied by xdmp:http-get, unfortunately. But once you 
debugged one call, the headers of other calls will likely look the same.. ;-)

Kind regards,
Geert

>


drs. G.P.H. (Geert) Josten
Consultant

Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:[email protected]
http://www.daidalos.nl/

KvK 27164984


De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

> From: [email protected]
> [mailto:[email protected]] On Behalf Of spig
> Sent: vrijdag 1 oktober 2010 16:16
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] How to get request
> headersforxdmp:http-get request
>
> Thanks everyone. I wondered if there was a way to inspect the
> headers before making the request. I ended up using a free
> online service to read the request and show me the headers being sent.
>
> --
> Steve
>
>
>
> On Thu, Sep 30, 2010 at 5:50 PM, Lee, David
> <[email protected]> wrote:
>
>
>       FYI, this one line xmlsh command (www.xmlsh.org) 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
>
>
>
>
>
>       <headers>
>
>          <header name="Host">
>
>             <value>localhost</value>
>
>          </header>
>
>          <header name="Accept-encoding">
>
>             <value>gzip, deflate</value>
>
>          </header>
>
>          <header name="Connection">
>
>             <value>Keep-Alive</value>
>
>          </header>
>
>          <header name="Accept-language">
>
>             <value>en-US</value>
>
>          </header>
>
>          <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>
>
>          <header name="Accept">
>
>             <value>*/*</value>
>
>          </header>
>
>       </headers>
>
>
>
>
>
>
>
>       From: [email protected]
> [mailto:[email protected]] 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: [email protected]
> [mailto:[email protected]] On Behalf Of spig
>       Sent: Thursday, September 30, 2010 6:54 PM
>       To: [email protected]
>       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?
>
>
>       --
>       Steve Spigarelli
>
>
>       _______________________________________________
>       General mailing list
>       [email protected]
>       http://developer.marklogic.com/mailman/listinfo/general
>
>
>
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to