## Not run:
# library("crul")
# (conn <- jsonapi_connect("http://localhost:8088"))
# conn$url
# conn$version
# conn$content_type
# conn$status()
# conn$routes()
# conn$routes(verbose = TRUE)
#
# # get data from speicific routes
# conn$route("authors")
# conn$route("chapters")
# conn$route("authors/1")
# conn$route("authors/1/books")
# conn$route("chapters/5")
# conn$route("chapters/5/book")
# conn$route("chapters/5/relationships/book")
#
# ## include
# conn$route("authors/1", include = "books")
# conn$route("authors/1", include = "photos")
# conn$route("authors/1", include = "photos.title")
#
# ## set curl options on jsonapi_connect() call
# xx <- jsonapi_connect("http://localhost:8088", verbose = TRUE)
# xx$opts
# xx$status()
#
# ## set headers on initializing the client
# (conn <- jsonapi_connect("http://localhost:8088", headers = list(foo = "bar")))
#
# ## errors
# ### route doesn't exist
# # conn$route("foobar")
#
# ### document doesn't exist
# # conn$route("authors/56")
# ## End(Not run)
Run the code above in your browser using DataLab