I know I can include the code explicitly, but I prefer to use the built-in function (if available).
div>
If you get the sample proxy from here: http://apigee.com/docs/api-services/content/api-proxy-samples, you will be in /simpleProxy A python example was found in /apiproxy/resources/py.
The strategy XML looks like this:
The python code looks like this:
import base64
username = flow.getVariable("request.formparam.client_id")
password = flow.getVariable("request.formparam.client_secret")
< br />base64string = base64.encodestring('%s:%s'% (username, password))[:-1]
flow.setVariable("my.base64.blob", base64string)
Or, if python is not your style, you could do this in javascript using js resources, or even directly in Node.js proxy.
What is the easiest way to perform Base64 encoding in the Apigee strategy? I need to encode the SMS text to be sent programmatically.
I know I can include the code explicitly, but I prefer to use the built-in function (if available).
p>
The most effective way is to create a python script policy, and then use python’s built-in base64 module to build a simple function base64 encoding or – decoding parameters.
If you get a sample proxy from here: http://apigee.com/docs/api-services/content/api-proxy-samples, you will find a python sample in /simpleProxy/apiproxy/resources/py.
The policy XML looks like this:
The python code looks like this:
import base64
username = flow.getVariable("request.formparam.client_id")
password = flow.getVariable("request.formparam.client_secret")
base64string = base64.encodestring('%s :%s'% (username, password))[:-1]
flow.setVariable("my.base64.blob", base64string)
Or, if python is not Your style, you could do this in javascript using js resources, even directly in Node.js proxy.
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 508 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC