Scripting API : Documentation

The following variables are available globally in the script

  • httpReq
    • Description

      use this variable to modify the outgoing HTTP Request.  To find out the methods supported by this variable, type out "httpReq." (without qoutes) in the editor. An intellisense window will popup after the "."

    • Methods
      • AddCookie(name,value)
      • AddFile(name,bytes,fileName)
      • AddFile (name,bytes,fileName,contentType)
      • AddFile(name,path)
      • httpReq.AddHeader(name,value)
      • httpReq.AddRequestBody(contentType,reqBody)
      • httpReq.ClearCookies()
      • httpReq.ClearHeaders()
      • httpReq.ClearRequestBody()
    • Readonly Properties
      • Attempts : int32
      • Cookies : Dictionary
      • hHttpHeaders : Dictionary
      • RequestBody : string
    • Read/Write Properties
      • Credentials : System.Net.ICredentials
      • DateFormat : string
      • IsSendingNameValuePairs : bool
      • Method : Verb
      • RequestFormat : ContentType
      • Timeout : int32
      • Uri : System.Uri
  • dataCache
    • Description

      use this variable to persist data across multiple http calls. This variable is of type System.Collections.Generic.Dictionary

    • Example usage:

      if dataCache.ContainsKey('counter') == False:
             dataCache['counter'] = 0

  • scriptLog
    • Methods
      • Info(msg)
      • Warning(msg)
      • Error(msg)
      • Error(exception)
    • Example Usage

           scriptLog.Info("Test logging")

 

For an example on how to use this variables, please see Modifying HTTP Requests using a script


Site Map | Printable View | © 2008 - 2024 WCFStorm Solutions

Powered by mojoPortal | XHTML 1.0 | CSS | Design by styleshout