Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

I have written some simple VBScript code to use a GET REST HTTP request. It is as follows:

endpoint="somethingsomething" 

parameter ="?someparameters&sysparm_limit=10000"  

Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP.6.0")  

URL = endpoint & resource & parameter 

On Error Resume Next   

objXmlHttpMain.open "GET",URL, False, "admin", "jhdsjkF"  

objXmlHttpMain.setRequestHeader "Content-Type", "application/xml"

objXmlHttpMain.setRequestHeader "Accept", "application/xml"

objXmlHttpMain.setRequestHeader "UserID", "admin"

objXmlHttpMain.setRequestHeader "Password", "jhdsjkF"

objXmlHttpMain.send

response = objXmlHttpMain.responsetext

Ideally, I want to store this response in a UIPath string variable to use it further in the sequence. Is there a way to do that?

However, if there isn't could you assist me in putting this response in a text file? I want the text file to be the same no matter how many times the VBScript is executed, and for the response to be written after the file gets cleared.

1 Answer

0 votes
by (29.5k points)

Hi, try using Scripting.FileSystemObject or ADODB.Stream to save response to a file maybe it'll work

Related questions

0 votes
1 answer
asked Jul 18, 2019 in RPA by noah kapoor (5.3k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in RPA by Abhishek_31 (12.7k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...