Class ContentLoader

All Implemented Interfaces:
IConfigurableObject, INotScriptFriendly, ISupportsDeprecation, IDiffableObject, IAvatar, IEntityLifeCycleEvent, IPersistable, IServiceProvider, ITaggableObject, IDependencyScannableObject, IEntityDefinition, IPersistableObject<String>, IDesignTimeSecurable, IDesignTimeSecurableEntity, IRunTimeSecurable, IRunTimeSecurableEntity, ISecurable, IVisibilitySecurable, IVisibilitySecurableEntity, IAspectContainer, INamedObject, Serializable

@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public class ContentLoader extends Resource
See Also:
  • Constructor Details

    • ContentLoader

      public ContentLoader()
  • Method Details

    • GetCookies

      @ThingworxExtensionApiMethod(since={6,6}) public String GetCookies(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Cookies
      Service Description:
      Issue a URL call and get the returned cookies back.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Cookies - STRING
      Throws:
      Exception - If an error occurs
    • Delete

      @ThingworxExtensionApiMethod(since={6,6}) public void Delete(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Delete
      Service Description:
      Invoke an HTTP delete request on a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Throws:
      Exception - If an error occurs
    • GetText

      @ThingworxExtensionApiMethod(since={6,6}) public String GetText(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme, Boolean appendHeader) throws Exception
      Service Category:
      Text
      Service Description:
      Get text content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      appendHeader - Append header in response; optional: default value is true - BOOLEAN
      Returns:
      result Loaded content as text content - STRING
      Throws:
      Exception - If an error occurs
    • GetXML

      @ThingworxExtensionApiMethod(since={6,6}) public Document GetXML(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      XML
      Service Description:
      Get XML content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as text content - XML
      Throws:
      Exception - If an error occurs
    • GetJSON

      @ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetJSON(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      JSON
      Service Description:
      Get json content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as text content - JSON
      Throws:
      Exception - If an error occurs
    • LoadXML

      @ThingworxExtensionApiMethod(since={6,6}) public Document LoadXML(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      XML
      Service Description:
      Load XML Content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as XML document - XML
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • LoadText

      @ThingworxExtensionApiMethod(since={6,6}) public String LoadText(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme, Boolean appendHeader) throws Exception
      Service Category:
      Text
      Service Description:
      Load text content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      appendHeader - Append header in response; optional: default value is true - BOOLEAN
      Returns:
      result Loaded content as text content - STRING
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • LoadImage

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] LoadImage(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Image
      Service Description:
      Load image content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as an image primitive - IMAGE
      Throws:
      Exception - If an error occurs
    • LoadBinary

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] LoadBinary(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Binary
      Service Description:
      Load binary content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as an blob/binary primitive - BLOB
      Throws:
      Exception - If an error occurs
    • LoadJSON

      @ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject LoadJSON(String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      JSON
      Service Description:
      Load JSON content from a URL.
      Parameters:
      url - URL to load - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as a JSON Object - JSON
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PostText

      @ThingworxExtensionApiMethod(since={6,6}) public String PostText(String url, String content, String contentType, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Text
      Service Description:
      Load text content from a URL via HTTP POST.
      Parameters:
      url - URL to load - STRING
      content - Posted content as string - STRING
      contentType - Posted content type as string - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as string - STRING
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PostMultipart

      @ThingworxExtensionApiMethod(since={7,2,1}) public org.json.JSONObject PostMultipart(String url, String repository, String pathOnRepository, Object partsToSend, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Parameters:
      url - URL to load - STRING
      repository - Repository to get file from to upload - STRING
      pathOnRepository - Path on repository to file - STRING
      partsToSend - Infotable where each field is a part to send - INFOTABLE
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Throws:
      Exception - If an error occurs
    • PostMultipart

      @ThingworxExtensionApiMethod(since={9,4,4}) public org.json.JSONObject PostMultipart(String url, String repository, String pathOnRepository, Object partsToSend, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme, Boolean useUTF8Encoding) throws Exception
      Service Category:
      Multipart
      Service Description:
      Multipart data upload from Thingworx to and external target via HTTP POST.
      Parameters:
      url - URL to load - STRING
      repository - Repository to get file from to upload - STRING
      pathOnRepository - Path on repository to file - STRING
      partsToSend - Infotable where each field is a part to send - INFOTABLE
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      useUTF8Encoding - Supports with UTF8 characters - BOOLEAN
      Returns:
      result Response as JSON Object - JSON
      Throws:
      Exception - If an error occurs
    • PostImage

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] PostImage(String url, byte[] content, String mimeType, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Image
      Service Description:
      Load Image content from a URL via HTTP POST.
      Parameters:
      url - URL to load - STRING
      content - Posted content as image - IMAGE
      mimeType - Mime Type - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as BLOB Object - BLOB
      Throws:
      Exception - If an error occurs
    • PostBinary

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] PostBinary(String url, byte[] content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Binary
      Service Description:
      Load binary content from a URL via HTTP POST.
      Parameters:
      url - URL to load - STRING
      content - Posted content as image - BLOB
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as BLOB Object - BLOB
      Throws:
      Exception - If an error occurs
    • PostJSON

      @ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject PostJSON(String url, org.json.JSONObject content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      JSON
      Service Description:
      Load JSON content from a URL via HTTP POST.
      Parameters:
      url - URL to load - STRING
      content - Posted content as JSON object - JSON
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as JSON Object - JSON
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PostXML

      @ThingworxExtensionApiMethod(since={6,6}) public Document PostXML(String url, Document content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      XML
      Service Description:
      Load XML content from a URL via HTTP POST.
      Parameters:
      url - URL to load - STRING
      content - Posted content as XML document. The xml content must start with an xml declaration, ie <?xml version="1.0" encoding="UTF-8"?> - XML
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as XML document - XML
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PutJSON

      @ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject PutJSON(String url, org.json.JSONObject content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      JSON
      Service Description:
      Load JSON content from a URL via HTTP PUT.
      Parameters:
      url - URL to load - STRING
      content - Posted content as JSON object - JSON
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as JSON Object - JSON
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PutBinary

      @ThingworxExtensionApiMethod(since={6,6}) public byte[] PutBinary(String url, byte[] content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Binary
      Service Description:
      Load binary content from a URL via HTTP PUT.
      Parameters:
      url - URL to load - STRING
      content - Posted content as image - BLOB
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as BLOB Object - BLOB
      Throws:
      Exception - If an error occurs
    • PutText

      @ThingworxExtensionApiMethod(since={6,6}) public String PutText(String url, String content, String contentType, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Text
      Service Description:
      Load text content from a URL via HTTP PUT.
      Parameters:
      url - URL to load - STRING
      content - Posted content as string - STRING
      contentType - Posted content type as string - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as a string - STRING
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • PutXML

      @ThingworxExtensionApiMethod(since={6,6}) public Document PutXML(String url, Document content, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Boolean withCookies, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      XML
      Service Description:
      Load XML content from a URL via HTTP PUT.
      Parameters:
      url - URL to load - STRING
      content - Posted content as XML document - XML
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      withCookies - Include cookies in response - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as XML document - XML
      Throws:
      Exception - If an error occurs

      Additional Information:
      If the parsing of the header fails, an exception is logged and the request execution continues. If the client code, which is expecting the header, has an exception (because the parsing of the header object previously failed), you can debug and find the header parsing errors in the logs.

    • LoadMediaEntity

      @ThingworxExtensionApiMethod(since={6,6}) public String LoadMediaEntity(String name, String description, TagCollection tags, String url, String username, String password, org.json.JSONObject headers, Boolean ignoreSSLErrors, Double timeout, Boolean useNTLM, String workstation, String domain, Boolean useProxy, String proxyHost, Integer proxyPort, String proxyScheme) throws Exception
      Service Category:
      Image
      Service Description:
      Load an image via URL and create/update a media entity.
      Parameters:
      name - Name of the media entity to save or update - STRING
      description - Description for the media entity to save - STRING
      tags - Tags for the media entity to save - TAGS
      url - URL to load an image - STRING
      username - Optional user name credential - STRING
      password - Optional password credential - STRING
      headers - Optional HTTP headers - JSON
      ignoreSSLErrors - Ignore SSL Certificate Errors - BOOLEAN
      timeout - Optional timeout in seconds - NUMBER
      useNTLM - Use NTLM Authentication - BOOLEAN
      workstation - Auth workstation - STRING
      domain - Auth domain - STRING
      useProxy - Use Proxy server - BOOLEAN
      proxyHost - Proxy host - STRING
      proxyPort - Proxy port - INTEGER
      proxyScheme - Proxy scheme - STRING
      Returns:
      result Loaded content as image - IMAGELINK
      Throws:
      Exception - If an error occurs