Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Using Ionic native http on mobile device

$
0
0

Hello,
I using Ionic native http to manage the user using IBM APPID. I´m using this lib to authenticate, reset password and retrieve user´s profile.
However, when I´m using the http for creating a new user a get this error:

{
    "status": 400,
    "url": "https://us-south.appid.cloud.ibm.com/management/v4/{tenentid}/cloud_directory/sign_up",
    "headers": {
        "date": "Wed, 25 Nov 2020 19:09:15 GMT",
        "content-length": "102",
        "server": "cloudflare",
        "expires": "0",
        "x-android-selected-protocol": "http/1.1",
        "x-android-received-millis": "1606331101911",
        "x-frame-options": "SAMEORIGIN",
        "x-download-options": "noopen",
        "connection": "keep-alive",
        "content-type": "application/json; charset=utf-8",
        "cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate",
        "surrogate-control": "no-store",
        "cf-request-id": "06a268685a0000f3b78b8fe000000001",
        "cf-ray": "5f7da9ba2a65f3b7-GRU",
        "x-android-response-source": "NETWORK 400",
        "x-android-sent-millis": "1606331101070",
        "cf-cache-status": "DYNAMIC",
        "expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
        "pragma": "no-cache",
        "strict-transport-security": "max-age=15552000; includeSubDomains, max-age=31536000; includeSubDomains",
        "content-security-policy": "frame-ancestors 'none'",
        "x-content-type-options": "nosniff",
        "x-xss-protection": "1; mode=block",
        "x-dns-prefetch-control": "off",
        "etag": "W/\"66-ofIdsT9EjtpqldvGcbv/Q3MysYE\""
    },
    "**error": "{\"errorCode\":\"INVALID_REQUEST\",\"message\":\"data.active should be boolean, data.emails should be array\"}"**
}

And I´m providing this data:

{"active": true,"emails": [{"value": "user@test.com","primary": true}],"userName": "12345677","password": "12345678"}

I have used the same data via Postman, Curl and Swagger, and all works just fine.
It seems something is getting lost when using the http native.
Any help is appreciate.

Ionic:

   Ionic CLI                     : 6.12.1 
   Ionic Framework               : @ionic/angular 5.4.1
   @angular-devkit/build-angular : 0.1002.0
   @angular-devkit/schematics    : 10.2.0
   @angular/cli                  : 10.2.0
   @ionic/angular-toolkit        : 2.3.3

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 9 other plugins)

Utility:

   cordova-res : 0.15.2
   native-run  : 1.2.2

System:

   Android SDK Tools : 26.1.1 
   NodeJS            : v14.2.0 
   npm               : 6.14.4
   OS                : Windows 10

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>