Hi, you need to register an user, for example:
➜ mystore git:(master) curl -i --request POST \ <<< --url http://localhost:8088/register \ --header 'content-type: application/json' \ --data '{ "email": "name@domain.com", "company": "My Company", "password":"password", "password_confirmation": "password" }' HTTP/1.1 200 OK content-length: 92 content-type: application/json date: Tue, 06 Aug 2019 12:38:34 GMT {"email":"name@domain.com","company":"My Company","created_at":"2019-08-06T09:38:41.833136"}%
Then you need to login:
➜ mystore git:(master) curl -i --request POST \ <<< --url http://localhost:8088/auth \ --header 'content-type: application/json' \ --data '{ "email": "name@domain.com", "password":"password" }' HTTP/1.1 200 OK content-length: 92 content-type: application/json x-csrf-token: 41130a33c627781f7dd0f81d95a33ca4223b8d85b322386793aacb97aa13833115b85913951dafceead03516e870f682d077e300c0ceb030371984d9133ca002991aec8fad22c391 set-cookie: mystorejwt=4LKhublDMvdz0/tU/lZVLQAwj8pSqNLsRl8heiOM8LMyH3pekc7PSdEit09j4eXYFCMcLt+2h+Wxf2U1aoDN2/8J+3hVt/61z3EXTBnGNe/oig3qh0Ftz2mt6OBXjwot5EjogsXtFEbje4TSMby0zE3yy+xOLhejEseBdABz0F6YhNls8zPw2UA7bH+RZ6Fa471Ph83IU0XVhqHDcgz9uQAtlgTs/BnX6EorDK2xTmIDgiWRWr6DCNB005sf76rT4emFbV6DlORe95s8Hh702Q==; HttpOnly; Path=/; Domain=localhost; Max-Age=86400 date: Tue, 06 Aug 2019 12:40:04 GMT {"email":"name@domain.com","company":"My Company","created_at":"2019-08-06T09:38:41.833136"}%
You copy the cookie and csrf token and pass them through the request:
curl -v --cookie "mystorejwt=4LKhublDMvdz0/tU/lZVLQAwj8pSqNLsRl8heiOM8LMyH3pekc7PSdEit09j4eXYFCMcLt+2h+Wxf2U1aoDN2/8J+3hVt/61z3EXTBnGNe/oig3qh0Ftz2mt6OBXjwot5EjogsXtFEbje4TSMby0zE3yy+xOLhejEseBdABz0F6YhNls8zPw2UA7bH+RZ6Fa471Ph83IU0XVhqHDcgz9uQAtlgTs/BnX6EorDK2xTmIDgiWRWr6DCNB005sf76rT4emFbV6DlORe95s8Hh702Q==; Path=/; Domain=localhost; Max-Age=86400" --header "x-csrf-token: 41130a33c627781f7dd0f81d95a33ca4223b8d85b322386793aacb97aa13833115b85913951dafceead03516e870f682d077e300c0ceb030371984d9133ca002991aec8fad22c391" -H "Content-Type: application/json" http://localhost:8088/products\?search\="products"
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, you need to register an user, for example:
Then you need to login:
You copy the cookie and csrf token and pass them through the request: