Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Basic Ocamlnet Question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-14 (17:39)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Basic Ocamlnet Question
Zitat von

> Hi,
> I've just started messing about with ocamlnet, and have instantly run
> into a problem.  I was trying to write some code that interfaced with  the
> backpack API (  I tried
> tweaking one of the examples just to get a page listing, and wrote the
> following:
> open Http_client.Convenience;;
> let get_and_print url  =
>    let s = http_post url [("","<request> <token>mytoken</token>
> </request>")] in
>    print_string s;
>    flush stdout
> ;;
> let () = get_and_print "";;
> However, this doesn't work, as the header for the request should be
> "Content-Type: application/xml".  How do I set the header for my request
> in ocamlnet?

The Convenience-Module is very convenient for simple
things, IMHO.
I have tried it and found it very funny to use.

But I think for more sophisticated things you have to use the
other modules. I'm not sure, but I think (as far as I have
seen it) the Convenience-module is not powerful enough for
special things.

There are a lot of other modules that can do what you want.
(No example here, because for my simple needs when I have
looked at it, I was happy enough with the Convenience module).