Advertisement
markgregory

CFScript - part1

Apr 25th, 2011
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // CFHTTP:
  2. objMyHttpPost = new HTTP(url='http://somewebsite.com/gateway/api.php', method="post");
  3. objMyHttpPost.addParam(type='formfield',    name='someField',   value='someValue');
  4. objMyHttpPost.addParam(type='formfield',    name='anotherField',    value='anotherValue');
  5. // send the post and assign the result to a variable, this will gave a result like cfhttp.fileContent  
  6. postResponse = objMyHttpPost.send().getPrefix();
  7.  
  8.  
  9. // CFFLUSH
  10.  getPageContext().getOut().flush();
  11.  
  12.  
  13. // CFSWITCH
  14.  switch(myVar)
  15. {
  16.     case 'PS':
  17.         local.accountType = 'S';
  18.         break;
  19.     case 'CS':
  20.         local.accountType = 'S';
  21.         break;
  22.     default:
  23.         local.accountType = 'C';
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement