Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Client Endpoint #14

Closed
Clivern opened this issue Nov 21, 2018 · 1 comment · Fixed by #18
Closed

Add Client Endpoint #14

Clivern opened this issue Nov 21, 2018 · 1 comment · Fixed by #18
Assignees

Comments

@Clivern
Copy link
Owner

Clivern commented Nov 21, 2018

No description provided.

@Clivern Clivern self-assigned this Nov 21, 2018
@Clivern Clivern changed the title Add Clients Endpoint Add Client Endpoint Nov 21, 2018
@Clivern
Copy link
Owner Author

Clivern commented Nov 30, 2018

~ curl -X POST -H "X-AUTH-TOKEN: 123" -d '{}' "http://localhost:8080/api/client" | python -m json.tool

{
    "created_at": 1543585664,
    "id": "1dbb0ac1-97c5-4aa9-ba08-f02ebfb49b1a",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiMWRiYjBhYzEtOTdjNS00YWE5LWJhMDgtZjAyZWJmYjQ5YjFhIiwidGltZXN0YW1wIjoxNTQzNTg1NjY0fQ.4yXo_g2OY31i9bwgPfkwLjls4nGXfiSGx0UM8Cvbw0k",
    "updated_at": 1543585664
}


➜  ~ curl -X GET -H "X-AUTH-TOKEN: 123" -d '{}' "http://localhost:8080/api/client/1dbb0ac1-97c5-4aa9-ba08-f02ebfb49b1a" | python -m json.tool

{
    "created_at": 1543585664,
    "id": "1dbb0ac1-97c5-4aa9-ba08-f02ebfb49b1a",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiMWRiYjBhYzEtOTdjNS00YWE5LWJhMDgtZjAyZWJmYjQ5YjFhIiwidGltZXN0YW1wIjoxNTQzNTg1NjY0fQ.4yXo_g2OY31i9bwgPfkwLjls4nGXfiSGx0UM8Cvbw0k",
    "updated_at": 1543585664
}


➜  ~ curl -X DELETE -H "X-AUTH-TOKEN: 123" -d '{}' "http://localhost:8080/api/client/1dbb0ac1-97c5-4aa9-ba08-f02ebfb49b1a" -v         
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> DELETE /api/client/1dbb0ac1-97c5-4aa9-ba08-f02ebfb49b1a HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.43.0
> Accept: */*
> X-AUTH-TOKEN: 123
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 2 out of 2 bytes
< HTTP/1.1 204 No Content
< Date: Fri, 30 Nov 2018 13:48:47 GMT
<
* Connection #0 to host localhost left intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant