Skip to content

Instantly share code, notes, and snippets.

@baskaran-md
Last active August 29, 2015 14:00
Show Gist options
  • Save baskaran-md/11203963 to your computer and use it in GitHub Desktop.
Save baskaran-md/11203963 to your computer and use it in GitHub Desktop.
Python Encoder [Apigee]
from com.apigee.util import Crypto
authHeader = flow.getVariable("request.formparam.user") + ":" + flow.getVariable("request.formparam.password");
encodedValue = Crypto.base64encode(authHeader);
flow.setVariable("request.header.Authorization", "Basic " + encodedValue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment