English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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:30)
From: Peter.Gregory@c...
Subject: Basic Ocamlnet Question

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 

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 "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?