1

How can i send request to the URL:8080 port and get the Text output and Authenticate too ?

<field label_name="Get Results" type="button" link="http://URL:8080/" authenti_username="***" authenti_password="***" service_method="POST" server_athenti_method="Basic" ssl_certificate="None" ssl_key="None" response_contains="text" output="text"/>
Abraham K
  • 624
  • 1
  • 8
  • 24

1 Answers1

1
var xml = new XMLHttpRequest();
xml.open('GET', 'some url', true);
xml.setRequestHeader('Authorization', auth); // <<<<----- USED HERE
xml.send();

You can do this way or your can also use jQuery ajax call

Update upon REQUEST:

var xml = new XMLHttpRequest();
xml.open('GET', 'http://URL:8080', true);
xml.setRequestHeader('Authorization', "BASIC eHh4Onl5eQ=="); // <<<<----- USED HERE
xml.send();

eHh4Onl5eQ== is base64 encode form of username:password i.e xxx:yyy. You can do the conversion online here.

Try it out, it's a pseudo code.

Madhusudan Joshi
  • 4,438
  • 3
  • 26
  • 42
  • can you be more specific.. first i got url lyk 8080 port.. [http://URL:8080/dir] which has Authentication like username:xxx password:yyy , and i have to POST two values over the url and get the text output..can you mention the coding part ? – Abraham K May 08 '13 at 12:21
  • Now how can i POST some 2 parameters over the authenticated URL.. ? lyk data1 & data2 and get text output ? – Abraham K May 08 '13 at 12:37
  • in that `xml.send()` you can pass an `FormData` object. try it out by yourself. – Madhusudan Joshi May 08 '13 at 12:47