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
