• cnaccio@thehelpdesk.com
  • 0 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

A small note I'll toss up here because I ran into it.  This is just informational.


The few lines of sample code for an HttpRequest call using a username/password was nice to have in the documentation.  It was just what I needed, and it was already done for me.  No thinking required.  :-)



Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
req.setHeader('Authorization', authorizationHeader);

 However, I was integrating with a service which has strictly implemented basic authentication and thus they deny the string "BASIC" and require the string "Basic" which is what I believe is in the Spec: http://tools.ietf.org/html/rfc2617.  Of course they didn't document that anywhere.


So, I post this just because if someone else had posted it I wouldn't have wasted an hour making sure every other darn thing was perfect before I figured this out.


Hope it helps someone, Steve.