From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6E6DFBC6B for ; Tue, 14 Aug 2007 19:39:19 +0200 (CEST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7EHdGY0030621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 14 Aug 2007 19:39:19 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l7EHdEa4019474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Aug 2007 19:39:15 +0200 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.13.6/8.13.6/Submit) id l7EHdELF019472 for caml-list@yquem.inria.fr; Tue, 14 Aug 2007 19:39:14 +0200 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dslb-088-074-017-220.pools.arcor-ip.net (dslb-088-074-017-220.pools.arcor-ip.net [88.74.17.220]) by webmail.in-berlin.de (IMP) with HTTP for ; Tue, 14 Aug 2007 19:39:14 +0200 Message-ID: <1187113154.46c1e8c208ba5@webmail.in-berlin.de> Date: Tue, 14 Aug 2007 19:39:14 +0200 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Basic Ocamlnet Question References: <1628.84.13.116.50.1187112599.squirrel@webmail.cis.strath.ac.uk> In-Reply-To: <1628.84.13.116.50.1187112599.squirrel@webmail.cis.strath.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at concorde with ID 46C1E8C4.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 ocamlnet:01 ocamlnet:01 tweaking:01 stdout:01 token:01 token:01 imho:01 wrote:01 oliver:01 oliver:01 caml-list:01 modules:02 modules:02 Zitat von Peter.Gregory@cis.strath.ac.uk: > 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 (http://developer.37signals.com/backpack/). 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 [(""," mytoken > ")] in > print_string s; > flush stdout > ;; > > let () = get_and_print "http://pg.backpackit.com/ws/pages/all";; > > > 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). Ciao, Oliver