Invalid_http_body_in_request

I'm getting a code -201 to one of my web requests on an Edge 820. It works perfectly fine in the simulator, and I the data I see on the server looks correct. This actually was working before, so not sure how/what I broke. I have two other web requests that go through just fine, and one that doesn't.

Does anyone know what generates that error? The Edge is using Bluetooth to my phone for internet, if that makes a difference.

I'm going to keep playing with it, but if someone knows what throws that code, and where it is being thrown, I would appreciate it!
  • What type of phone do you have (Android or iOS), what version of the OS, and what version of GCM? Maybe post your code for the request?
  • Like I said, the others all work. Trying to figure out where this actually gets thrown. I'm using Android.

    Comm.makeWebRequest(
    "http://##.##.##.##/something",
    opt, // dictionary variable
    {
    },
    method(:onComplete)
    );


    It was actually working yesterday, so that is the confusing part, and the fact that I have two other identical requests that work. They are all formed the same way, opt changes, but it is a valid dictionary. Using the defaults, this should be a get request, so there should be nothing in the body.
  • Former Member
    Former Member over 8 years ago
    Are any of the parameter names/values you're passing a type other than a String? If you add a .toString() to the end of the value does it start working? We had a bug fix for makeWebRequest in the Android code recently that fixed an issue where if you passed a non string Android would kick it back as an invalid request.

    var area = Math.PI * radius * radius;
    Comm.makeWebRequest(
    "some.url.com",
    {
    "pi" => 3.1415, <--- This would cause a problem
    "e" => "2.7183", <--- This is ok
    "area" => area.toString() <--- This is also ok
    },
    null,
    method(:callback)
    );
  • Are any of the parameter names/values you're passing a type other than a String? If you add a .toString() to the end of the value does it start working? We had a bug fix for makeWebRequest in the Android code recently that fixed an issue where if you passed a non string Android would kick it back as an invalid request.

    var area = Math.PI * radius * radius;
    Comm.makeWebRequest(
    "some.url.com",
    {
    "pi" => 3.1415, <--- This would cause a problem
    "e" => "2.7183", <--- This is ok
    "area" => area.toString() <--- This is also ok
    },
    null,
    method(:callback)
    );


    This solved it. One of the variables was a number. Converted it to a string and it went through. For the record, I'm on version 3.1 on Android.