Skip to content

Instantly share code, notes, and snippets.

@mverzilli
Created March 20, 2013 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mverzilli/5208713 to your computer and use it in GitHub Desktop.
Save mverzilli/5208713 to your computer and use it in GitHub Desktop.
Mi primer programa Erlang :)
-module(test).
-export([get_layers/2]).
auth_header(User, Pass) ->
Encoded = base64:encode_to_string(lists:append([User, ":", Pass])),
{"Authorization", "Basic " ++ Encoded}.
get_layers(User, Pass) ->
Headers = [auth_header(User, Pass)],
httpc:request(get, {"http://facilities.moh.gov.rw/collections/26/layers.json", Headers}, [], []).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment