• Creator
    Topic
  • #4431
    stschaefer
    Participant

    I folks,

    what I want to do:
    Calling a website and use the result. I guess the right way is to create a WebRequest and handle the response in a stream.

    Is that possible in Formativ? Tried to create a WebRequest with that code, but it didn’t work:

    Dim myRequest : Set myRequest = WebRequest.Create(url)

    Greetings,
    Stefan

  • Author
    Replies
  • #8163
    Support 3
    Participant

    WebRequest in System.Net namespace, we are not sure whether you can use it in VBScript.

    However, you can use HTMLDom object then use its methods to access URL. In Formativ, you can use “Utilities.HTMLDom” to acesss HTMLDom object, see the Formativ Language guide for more information.

    Sample code below access the URL using Utilities.HTMLDom then use Document (IHTMLDocument2 instance) to get InnerHtml.

      
      dim oHtmlDom
    
      set oHtmlDom = Utilities.HTMLDom
      if (oHtmlDom.LoadFromURL("http://mycompany.com")) then
         msgbox oHtmlDom.document.body.innerhtml
      end if
    
      set oHtmlDom = nothing
    

    Regards,
    Advansys Support

    #8164
    stschaefer
    Participant

    Once more, you helped me out. Smile

    The code works perfectly. Thanks!

    #8162
    Support 3
    Participant

    No problem, glad to be of assistance.

    Regards,
    Advansys Support

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.