caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: oliver@first.in-berlin.de
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Ocamlnet and sending Referrer
Date: Thu, 23 Dec 2010 00:49:13 +0100	[thread overview]
Message-ID: <1293061753.22147.517.camel@thinkpad> (raw)
In-Reply-To: <20101222193907.GA8091@siouxsie>

Am Mittwoch, den 22.12.2010, 20:39 +0100 schrieb
oliver@first.in-berlin.de:
> Hi,
> 
> 
> for a simple script I used
> Http_client.Convenience from ocamlnet.
> 
> This module is really convenient and I enjoyed to have it
> for some simple get-calls. I'm quite happy with this.
> 
> But now I need to send a Referrer, and this seems not to work
> with this module.
> 
> What module must be used for sending a Referrer?
> And... just in case I may later will need Cookies also...
> ...what module can handle this?
> 
> Can this all be done with ocamlnet-stuff?
> If there are more than one possibility, which module
> would you recommend me (and why)?

The convenience module does not permit it to set additional headers. Use
the pipeline API:

open Http_client

let call = new get "http://host/path" ;;
(call # request_header `Base) # update_field "Referer" (* sic! *) "...";

let p = new pipeline ;;
p # add call ;;
p # run();;
if call # status = `Successful then
  let response = call # response_body # value in
  ...
else (* error case *)
  ...


Gerd

> 
> Ciao,
>    Oliver
> -----
> Caml-list mailing list.
> Subscription management: https://sympa-roc.inria.fr/wws/info/caml-list
> Archives: https://sympa-roc.inria.fr/wws/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 
> 
> 


-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


  parent reply	other threads:[~2010-12-22 23:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 19:39 oliver
2010-12-22 23:20 ` oliver
2010-12-22 23:49 ` Gerd Stolpmann [this message]
2010-12-23 13:52   ` oliver
2010-12-23 19:45     ` oliver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1293061753.22147.517.camel@thinkpad \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=oliver@first.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).