Skip to Content
avatar image
Former Member

Why am I getting Service Layer Login error "Bad POST Content"?

I am trying to login to Service Layer - I've tried from JS like this:

     $.ajax({method:'POST',
              url:'https://X.X.X.X:50000/b1s/v1/Login',
              data:{"CompanyDB":"****","UserName":"manager","Password":"********"},
              success: function (rsp) {
                  console.log("Got rsp:" + rsp);
              },
              error: function (xhr, status, error) {
                  console.log("Status: " + status + " Error:" + error);
                  console.log(xhr.responseText);
              }
          });

And from the command line with curl like this:

curl -k  https://X.X.X.X:50000/b1s/v1/Login -d CompanyDB=**** -d User=manager -d Password=********

I get the same result either way:

{"error" : {
      "code" : -1000,
      "message" : {
         "lang" : "en-us",
         "value" : "Bad POST content."
      }
}}

What am I doing wrong? Is Service Layer really telling me that I have a user/password issue? Or some other problem?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 27, 2017 at 07:02 PM

    The line

    data:{"CompanyDB":"****","UserName":"manager","Password":"********"},

    Should be

    data:'{"CompanyDB":"****","UserName":"manager","Password":"********"}',
    Add comment
    10|10000 characters needed characters exceeded