|
1 | 1 | # CURL commands for testing api
|
2 | 2 |
|
3 |
| -## User Registration |
4 |
| - |
5 |
| - curl --location --request POST 'http://localhost:8787/api/v1/user/save' \ |
| 3 | + |
| 4 | +## User Save |
| 5 | + |
| 6 | + curl --location --request GET 'http://localhost:8585/api/v1/user/3' \ |
6 | 7 | --header 'Content-Type: application/json' \
|
7 | 8 | --data-raw '{
|
8 |
| - "id" : 1, |
9 |
| - "userId" : "mehedi01", |
10 |
| - "password" : "123", |
11 |
| - "mobile" : "01835233447" |
| 9 | + "name":"mehedi", |
| 10 | + "email":"mehedi@gmail.com", |
| 11 | + "mobile":"01621640037", |
| 12 | + "gender":"male", |
| 13 | + "age":29, |
| 14 | + "nationality":"Bangladeshi" |
12 | 15 | }'
|
13 | 16 |
|
14 |
| -## User Login |
15 |
| - |
16 |
| - curl --location --request POST 'http://localhost:8787/api/v1/login' \ |
| 17 | +## User check by userId |
| 18 | + |
| 19 | + curl --location --request GET 'http://localhost:8585/api/v1/user/1' \ |
17 | 20 | --header 'Content-Type: application/json' \
|
18 | 21 | --data-raw '{
|
19 |
| - "userId" : "mehedi01", |
20 |
| - "password" : "123" |
| 22 | + "name":"mehedi", |
| 23 | + "email":"mehedi@gmail.com", |
| 24 | + "mobile":"01621640037", |
| 25 | + "gender":"male", |
| 26 | + "age":29, |
| 27 | + "nationality":"Bangladeshi" |
21 | 28 | }'
|
22 |
| - |
23 |
| -## User UserId Check |
24 | 29 |
|
25 |
| - curl --location --request POST 'http://localhost:8787/api/v1/user/forgetPass' \ |
| 30 | + |
| 31 | +## User validation |
| 32 | + |
| 33 | + curl --location --request POST 'http://localhost:8585/api/v1/user' \ |
26 | 34 | --header 'Content-Type: application/json' \
|
27 | 35 | --data-raw '{
|
28 |
| - "userId" : "mehedi01" |
| 36 | + "name":null, |
| 37 | + "email":"mehedigmail.com", |
| 38 | + "mobile":"0161640037", |
| 39 | + "gender":"male", |
| 40 | + "age":19, |
| 41 | + "nationality":"" |
29 | 42 | }'
|
30 | 43 |
|
31 |
| -## Reset Password |
| 44 | +## Output |
| 45 | + |
| 46 | + { |
| 47 | + "nationality": "must not be blank", |
| 48 | + "name": "Name shouldn't be null", |
| 49 | + "mobile": "mobile number should be valid", |
| 50 | + "age": "must be greater than or equal to 20", |
| 51 | + "email": "Email should be valid" |
| 52 | + } |
| 53 | + |
32 | 54 |
|
33 |
| - curl --location --request POST 'http://localhost:8787/api/v1/user/reset' \ |
| 55 | +## Exception Handle |
| 56 | + |
| 57 | + curl --location --request GET 'http://localhost:8585/api/v1/user/3' \ |
34 | 58 | --header 'Content-Type: application/json' \
|
35 | 59 | --data-raw '{
|
36 |
| - "userId" : "mehedi01", |
37 |
| - "password" : "123" |
| 60 | + "name":null, |
| 61 | + "email":"mehedigmail.com", |
| 62 | + "mobile":"0161640037", |
| 63 | + "gender":"male", |
| 64 | + "age":19, |
| 65 | + "nationality":"" |
38 | 66 | }'
|
| 67 | + |
| 68 | +## Output |
| 69 | + |
| 70 | + { |
| 71 | + "errorMessage": "User not found with this UserId : 3" |
| 72 | + } |
0 commit comments