0

I would like to state that I am new to the whole thing and sorry if I explain my problem badly.

I have an url (with some parameters) that i need to call in an app.js (it sends out an SMS)

If i call the URL in a web browser like this:

http://10.9.1.252:8111/goip/en/dosend.php?USERNAME=root&PASSWORD=root&smsprovider=2&smsnum=003630123456&method=2&Memo=Test"

It redirects me to another URL (this does the real sending, the messageID is refering to the first url):

http://10.9.1.252:8111/goip/en/resend.php?messageid=73&USERNAME=root&PASSWORD=root

I tried to make it work in app.js like this but it is not working as it needs to

 var sms_message = "http:/" + "/10.9.1.252:8111/goip/en/dosend.php?USERNAME=root&PASSWORD=root&smsprovider=2&smsnum=" + phone_number + "&method=2&Memo=";

    //test fetch for sms
    fetch(sms_message + 'hello')
        .then(res => {
            console.log(res.ok);
            console.log(res.status);
            console.log(res.statusText);
            console.log(res.headers.raw());
            console.log(res.headers.get('content-type'));
        });

My problem is that it does not do the redirect so my message is "stuck"/"lost" Is there any way to get this work like when it is used in a web browser, that it does the redirection too, or because it has php in the url it wont work?

Thanks in advance

  • 1
    Looks like you're sending this request over http (i.e. no encryption), so your username and password are being sent in plaintext. This is not recommended as it could easily be intercepted. – Harry Jun 03 '18 at 13:41
  • Thanks i did not find that post – Mihály Kovács Jun 03 '18 at 14:34

0 Answers0