I am trying to execute a HTTP GET command. Executing the command using cURL works perfectly
C:\cURL>curl -H "Content-Type: application/json" -u "ameya.barve@spirent.com:Spirent123!" "https://spirent.testrail.net/index.php?/api/v2/get_case/1" {"id":1,"title":"TestCase1","section_id":1,"type_id":7,"priority_id":2,"milestone_id":null,"refs":null,"created_by":1,"created_on":1445627870,"updated_by":1,"updated_on":1445629119,"estimate":null,"estimate_forecast":null,"suite_id":1, om_preconds":"Some pre-conditions go here","custom_steps":"1. Connect to device via telnet\r\n2. Login using credentials provided\r\n3. Execute 'show version\" command\r\n4. VERIFY version is \"12.10\"","custom_expected":null}
In the HTTP session profile, I have set the username, password and the content-type (MIME). However I get the following issues when executing the same above command in the session:
- The URL has a "?" which throws iTest as entering a "?" during capture always displays the help
- If instead of capturing I execute the command using a test case, I get this error: "Connect to https://spirent.testrail.net/index.php?/api/v2/get_case/1 failed, reason: Server returned HTTP response code: 400 for URL: https://spirent.testrail.net/index.php?/api/v2/get_case/1"
Any ideas what I am doing wrong?
(Note: The above API is available publicly so you can try executing the same command)