This repo contains the source code for running the Yahoo Champaign iOS class' Elide web service backend.
NOTE: Do not use real passwords with this service. It is not secure, and is only to be used for teaching purposes.
Send an HTTP post to /user
and set name
, email
, and password
:
POST /user HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Cache-Control: no-cache
Postman-Token: 49dcade2-9e91-49da-685e-c996b3580adb
{
"data": {
"type": "user",
"attributes": {
"name": "Shad Sharma",
"email": "[email protected]",
"password": "myPassword"
}
}
}
Send an HTTP post to /user/1/locations
with the attributes latitude
and longitude
. You need to provide your own user ID in the header as X-User-Id
and the password as X-User-Password
.
POST /user/1/locations HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-User-Id: 1
X-User-Password: myPassword
Cache-Control: no-cache
Postman-Token: fe119778-191b-4aa7-b5c1-1449e6bf4550
{
"data": {
"type": "location",
"attributes": {
"latitude": 1.23,
"longitude": 3.14
}
}
}
PATCH /user/1 HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-User-Id: 1
X-User-Password: myPassword
Cache-Control: no-cache
Postman-Token: eb7b7a72-1c9d-cc51-b173-c46c40691c5a
{
"data": {
"id": "1",
"type": "user",
"attributes": {
"name": "Shadanan Sharma",
"email": "[email protected]"
}
}
}
POST /user HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Cache-Control: no-cache
Postman-Token: 0cbfbc39-8d8b-f952-89c9-29230a5c4078
{
"data": {
"type": "user",
"attributes": {
"name": "Dennis McWherter",
"email": "[email protected]",
"password": "lolCatz"
}
}
}
POST /user HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Cache-Control: no-cache
Postman-Token: 8d0434bc-c7b8-34f5-13fe-ae98f5e9b549
{
"data": {
"type": "user",
"attributes": {
"name": "Xiaoyao Qian",
"email": "[email protected]",
"password": "china"
}
}
}
POST /user/1/relationships/friends HTTP/1.1
Host: localhost:8080
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-User-Id: 1
X-User-Password: myPassword
Cache-Control: no-cache
Postman-Token: 67ad7c78-af91-c344-3f9f-10d75bc3b42b
{
"data": [
{
"id": "2",
"type": "user"
}
]
}
GET /user HTTP/1.1
Host: localhost:8080
X-User-Id: 1
X-User-Password: myPassword
Cache-Control: no-cache
Postman-Token: e2159e97-1523-0e2a-2438-0ed0597c2b77
GET /user/1/friends?fields[user]=email,name,location HTTP/1.1
Host: localhost:8080
X-User-Id: 1
X-User-Password: myPassword
Cache-Control: no-cache
Postman-Token: f6ddf9fd-860c-ee57-ae33-6a6f6c61347e