curl -X GET http://localhost:3000/api/events/
response:
{
"events"=>
[
{
"title"=>"MyString",
"url"=>"MyString",
"image_url"=>"/uploads/event/image/8/rails.png",
"amount"=>1,
"effective_date"=>"2016-07-14",
"expire_date"=>"2016-07-14",
"engaged"=>1,
"available_quota"=>1,
"content"=>"detail",
"content_array"=>["hello", "world"],
"official_benefit"=>"official",
"official_benefit_array"=>=>["hello", "world"],
"additional_benefit"=>"additional",
"additional_benefit_array"=>["hello", "world"]
},
....
]
}
curl -X GET http://localhost:3000/api/events/{event.id}
curl -X GET --header "Authorization: Token token=#{openid}" http://localhost:3000/api/users/get_info
response:
{
"name"=>"foobar",
"cell"=>"1111111111",
"email"=>"[email protected]",
"gender"=>"男"
"state"=>"权益未激活"
}
curl -X PATCH --header "Authorization: Token token=#{openid}" -d "name=foobar&..." http://localhost:3000/api/users/update_profile
params: {
"name"=>"foobar",
"cell"=>"1111111111",
"email"=>"[email protected]",
"gender"=>"男"
}
curl -X POST -d "name=foobar&..." http://localhost:3000/api/customers/
params: {
"name"=>"foobar",
"cell"=>"11111111111",
"qq"=>"1111111111",
"desc"=>"many words"
}
response:
201 ok;422 ng
curl -X POST --header "Authorization: Token token=#{openid}" -d "event_id=1" http://localhost:3000/api/orders/
response:
201 ok;422 ng
curl -X GET --header "Authorization: Token token=#{openid}" http://localhost:3000/api/orders/
response:
{
"orders"=>
[
{
"id"=>34,
"date"=>"2016年7月15日",
"event_title"=>"MyString",
"amount"=>1,
"state"=>"未派发"
},
...
]
}
curl -X GET -d "url=http://www.baidu.com" http://localhost:3000/api/wx_get_jsapi_ticket