400 bad request for grails rest api

make sure the post body use ” instead of ‘

{“username”:”sp@ss.com”,”password”:”ss123″}

 

http://localhost:8080/api/login

  • the response
  • {
    “username”: “sp@ss.com”,
    “roles”: [
    “admin”
    ],
    “token_type”: “Bearer”,
    “access_token”: “eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTUDBzY1FSUlwvdTdsRGc1Qm9JSUxGMmNSMFlROWllWTFSTkJBV0k1elhHQkRtZHArYjBkbVp5Y3lzM2pYaHFsaFluR2dFd2FcL2dOekZOUGtCSWlyVFd0bm16bnU0bGpXU3I0YzF2ZlwvXC9lWEY1RDNScFl6QXpqd2taYUZCbVhrZFdHeTh4aVVoanUrbEZoMGFUb1NzVGJFdGloQ2R4K1FRaEJEQ0ZQSFR5TGQ5aythd29tcytiNzdpNG1ydFV6OEZxWmJNUzRZMWlPQjhyc1JmZmNpVEw0bDBCRkhSeUhNTEVGTXl4SlZDSGR1cEtyUGMwTnBsc3dYYzFpbGV6NTBmT0VibEE2em9RZGgwNmdaRjJCYVF4VHJIQWZGYWx5dEE2ZTNwb3RIQmZOTnJwV0RKT2FXVXZ1XC9rblNkdDY2dlwvYzJKU1g0QkoraDF0TUJmZFRkU3crTlBFKzBvb1NnMUZ4SnU5Q1J1VXI1RHZmaXhEOW9uSHdmWGd3NklRQjE4dXJoZjZyNTNESU1yclp2NXN1aWc4VEI3SmoxQ3RicWFYSXpVekZ2R3ZUS1A4NDNUcyt1RHo4OEltV1BXUHZcL2ZTeThHVFhYWDFHNVpvWTVOYllqb2oybytUT1JMejlNZnJlRmZ0VG11UlpJTDBvNlRPOGxLbUtLV3pOSzNQWHRvTTdTbkV0XC9lbXoxa3JWRW1KUG9rekt6WDFZVUsxclYwZVwvamI4TVhQNG5nSGRUM21TaVFLcCt1UU90RjNrWHo1ZktzTWZYMTExRVpZUFNZd3o5Ylp0cWFFQU1BQUE9PSIsInN1YiI6InNwQHNzLmNvbSIsInJvbGVzIj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ImlhdCI6MTQ2NTk3MTE5Mn0.9BQ9VY3SpZLLTbcDc8KiSNmwsBb9nc1wFtqfi019xno”
    }
Advertisements
This entry was posted in Grails. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s