Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. let fetch () =
  2. let open Lwt in
  3. let these_headers = [("authorization", " AWS4-HMAC-SHA256 Credential=\
  4. AKIAILZZXBN6HJNVMCXQ/20150323/\
  5. us-east-1/s3/aws4_request, \
  6. /SignedHeaders=host;x-amz-date, \
  7. /Signature=e0ff67b5b9a7970fffa824d\
  8. 013c9da0e5deabf4326c7b332bac2757951c5d73f");
  9. ("host", "s3.amazonaws.com");
  10. ("x-amz-date", "20150323T002435Z")] |> Cohttp.Header.of_list in
  11. Cohttp_lwt_unix.Client.call ~headers:these_headers `GET
  12. (Uri.of_string "https://s3.amazonaws.com\
  13. /obotoplay/test_files/Dino.stl")
  14. >>=
  15. fun (resp, body) ->
  16. print_endline "hello";
  17. Cohttp_lwt_body.to_string body >>= fun b ->
  18. Lwt_io.printl b
  19.  
  20. let _ =
  21. fetch ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement