You can also use curl --negotiate -u : for kerberos (provided curl is built with it and spengo). curl supports quite a few less used auth methods, but OP mentioned custom headers, not basic auth per se, (thats why I used Authentication instead of WWW-Authenticate or Authorization as an example)
Curl provides a shortcut for this as --user; e.g. curl --user name:pass http://example.com
Try it yourself with -vvv to see all the headers from both ends. Ref: http://curl.haxx.se/docs/httpscripting.html#Basic_Authentica...
http basic auth protocol: http://en.m.wikipedia.org/wiki/Basic_access_authentication