Skip to Content
0

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

Apr 26, 2017 at 08:33 PM

243

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Ari Heitner Apr 27, 2017 at 07:02 PM
0

The line

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

Should be

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