makeWebRequest issues

Former Member
Former Member

Hi all!

I am building an app that displays some data (plain text) from a website. I am able to get the text when testing it in the simulator, but on a real device (VA3), it returns error code -400 (INVALID_HTTP_BODY_IN_NETWORK_RESPONSE) and null for the data. The method is HTTP GET and the response type is set to plain text. The site supports HTTPS, so that shouldn't be a problem. What am I doing wrong?

function load()
{
    var options = 
        {
           	:method => Communications.HTTP_REQUEST_METHOD_GET,
           	:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_TEXT_PLAIN
       	};
    Communications.makeWebRequest(url, null, options, method(:dataDownloaded));
}

  • For things like this, ioS vs Android can matter so that's worth a mention,  You're not showing the url  and I suspect you may have some parameters attached to that.  You want to have the parameters as the second parameter in the makeWebRequest call, as not doing that, has caused the -400 in the past.  It will work in the sim, but not iOS for example.

  • Former Member
    Former Member over 6 years ago in reply to jim_m_58

    Thank you! It works now.