{"action":"created","comment":{"url":"https://api.github.com/repos/42BV/rest-convention/pulls/comments/55346202","id":55346202,"diff_hunk":"@@ -0,0 +1,146 @@\n+# Basic URL Design\n+\n+This chapter will show you how to design the \n+REST URL's for a specific resource. \n+\n+It will not cover the JSON structure of the\n+response and request bodies. This topic is\n+covered in chapter: JSON Object Design.\n+\n+Here is a quick cheat sheet for a 'car' resource:\n+\n+| URL           | method | response         |\n+| ------------- |--------| -----------------|\n+| /cars         | GET    | A list of cars   |\n+| /cars/1       | GET    | A single car     |\n+| /cars/1       | POST   | The created car  |  \n+| /cars/1       | PUT    | The updated car  |\n+| /cars/1       | PATCH  | The updated car  |\n+| /cars/1       | DELETE | The deleted car  |\n+\n+# Anatomy of a Resource.\n+\n+A REST API is a collection of resources. A Resource\n+represents something in the domain of your application.\n+For example: a domain for a webshop might have\n+Stock, Product and Customer resources.\n+\n+A resource is something that can be manipulated.\n+For example we can add, remove and update a resource.\n+\n+A resource can also be queried: we can get a list of\n+a particular resource, but we can retrieve the details of\n+a specific resource.\n+\n+Before REST we would create specific URL's for each\n+operation or query type. One URL to request a list,\n+one to delete a resource etc etc. With REST we define\n+one 'URL' for a resource and use verbs to manipulate\n+a resource.\n+\n+So what are these 'verbs'. \n+\n+# Request Methods\n+HTTP supports multiple 'requests methods' for a single\n+URL. Request methods are the 'verbs' which specify what \n+you want to happen when you request that url.\n+\n+The Request Methods that REST commonly use are: GET, POST, PUT, \n+PATCH and DELETE. These are all specified in the HTTP standard and","path":"02-basic-url-design.md","position":49,"original_position":49,"commit_id":"f9b12829644e6cea8f7658e3fff745f82c0db9f4","original_commit_id":"f9b12829644e6cea8f7658e3fff745f82c0db9f4","user":{"login":"Pouja","id":2385144,"avatar_url":"https://avatars.githubusercontent.com/u/2385144?v=3","gravatar_id":"","url":"https://api.github.com/users/Pouja","html_url":"https://github.com/Pouja","followers_url":"https://api.github.com/users/Pouja/followers","following_url":"https://api.github.com/users/Pouja/following{/other_user}","gists_url":"https://api.github.com/users/Pouja/gists{/gist_id}","starred_url":"https://api.github.com/users/Pouja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pouja/subscriptions","organizations_url":"https://api.github.com/users/Pouja/orgs","repos_url":"https://api.github.com/users/Pouja/repos","events_url":"https://api.github.com/users/Pouja/events{/privacy}","received_events_url":"https://api.github.com/users/Pouja/received_events","type":"User","site_admin":false},"body":"You can link here to https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3","created_at":"2016-03-08T11:20:26Z","updated_at":"2016-03-08T11:20:26Z","html_url":"https://github.com/42BV/rest-convention/pull/1#discussion_r55346202","pull_request_url":"https://api.github.com/repos/42BV/rest-convention/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/comments/55346202"},"html":{"href":"https://github.com/42BV/rest-convention/pull/1#discussion_r55346202"},"pull_request":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/42BV/rest-convention/pulls/1","id":61972678,"html_url":"https://github.com/42BV/rest-convention/pull/1","diff_url":"https://github.com/42BV/rest-convention/pull/1.diff","patch_url":"https://github.com/42BV/rest-convention/pull/1.patch","issue_url":"https://api.github.com/repos/42BV/rest-convention/issues/1","number":1,"state":"open","locked":false,"title":"Created the start of the chapter for the basic url design.","user":{"login":"MrHus","id":22608,"avatar_url":"https://avatars.githubusercontent.com/u/22608?v=3","gravatar_id":"","url":"https://api.github.com/users/MrHus","html_url":"https://github.com/MrHus","followers_url":"https://api.github.com/users/MrHus/followers","following_url":"https://api.github.com/users/MrHus/following{/other_user}","gists_url":"https://api.github.com/users/MrHus/gists{/gist_id}","starred_url":"https://api.github.com/users/MrHus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrHus/subscriptions","organizations_url":"https://api.github.com/users/MrHus/orgs","repos_url":"https://api.github.com/users/MrHus/repos","events_url":"https://api.github.com/users/MrHus/events{/privacy}","received_events_url":"https://api.github.com/users/MrHus/received_events","type":"User","site_admin":false},"body":"The chapter has a cheatsheet showing the basics of a REST resource\r\nincluding the URL and HTTP methods.\r\n\r\nThen \"Resource\" is defined and the various HTTP methods are\r\nfleshed out. Each HTTP request method has its own heading and\r\nabstract and concrete example.","created_at":"2016-03-07T20:09:17Z","updated_at":"2016-03-08T11:20:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4b1031dc42c6449ed505e401a3aea29bc06036","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/42BV/rest-convention/pulls/1/commits","review_comments_url":"https://api.github.com/repos/42BV/rest-convention/pulls/1/comments","review_comment_url":"https://api.github.com/repos/42BV/rest-convention/pulls/comments{/number}","comments_url":"https://api.github.com/repos/42BV/rest-convention/issues/1/comments","statuses_url":"https://api.github.com/repos/42BV/rest-convention/statuses/f9b12829644e6cea8f7658e3fff745f82c0db9f4","head":{"label":"42BV:basic_url_design","ref":"basic_url_design","sha":"f9b12829644e6cea8f7658e3fff745f82c0db9f4","user":{"login":"42BV","id":813733,"avatar_url":"https://avatars.githubusercontent.com/u/813733?v=3","gravatar_id":"","url":"https://api.github.com/users/42BV","html_url":"https://github.com/42BV","followers_url":"https://api.github.com/users/42BV/followers","following_url":"https://api.github.com/users/42BV/following{/other_user}","gists_url":"https://api.github.com/users/42BV/gists{/gist_id}","starred_url":"https://api.github.com/users/42BV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/42BV/subscriptions","organizations_url":"https://api.github.com/users/42BV/orgs","repos_url":"https://api.github.com/users/42BV/repos","events_url":"https://api.github.com/users/42BV/events{/privacy}","received_events_url":"https://api.github.com/users/42BV/received_events","type":"Organization","site_admin":false},"repo":{"id":53129512,"name":"rest-convention","full_name":"42BV/rest-convention","owner":{"login":"42BV","id":813733,"avatar_url":"https://avatars.githubusercontent.com/u/813733?v=3","gravatar_id":"","url":"https://api.github.com/users/42BV","html_url":"https://github.com/42BV","followers_url":"https://api.github.com/users/42BV/followers","following_url":"https://api.github.com/users/42BV/following{/other_user}","gists_url":"https://api.github.com/users/42BV/gists{/gist_id}","starred_url":"https://api.github.com/users/42BV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/42BV/subscriptions","organizations_url":"https://api.github.com/users/42BV/orgs","repos_url":"https://api.github.com/users/42BV/repos","events_url":"https://api.github.com/users/42BV/events{/privacy}","received_events_url":"https://api.github.com/users/42BV/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/42BV/rest-convention","description":"Drafting of the 42 REST Convention","fork":false,"url":"https://api.github.com/repos/42BV/rest-convention","forks_url":"https://api.github.com/repos/42BV/rest-convention/forks","keys_url":"https://api.github.com/repos/42BV/rest-convention/keys{/key_id}","collaborators_url":"https://api.github.com/repos/42BV/rest-convention/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/42BV/rest-convention/teams","hooks_url":"https://api.github.com/repos/42BV/rest-convention/hooks","issue_events_url":"https://api.github.com/repos/42BV/rest-convention/issues/events{/number}","events_url":"https://api.github.com/repos/42BV/rest-convention/events","assignees_url":"https://api.github.com/repos/42BV/rest-convention/assignees{/user}","branches_url":"https://api.github.com/repos/42BV/rest-convention/branches{/branch}","tags_url":"https://api.github.com/repos/42BV/rest-convention/tags","blobs_url":"https://api.github.com/repos/42BV/rest-convention/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/42BV/rest-convention/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/42BV/rest-convention/git/refs{/sha}","trees_url":"https://api.github.com/repos/42BV/rest-convention/git/trees{/sha}","statuses_url":"https://api.github.com/repos/42BV/rest-convention/statuses/{sha}","languages_url":"https://api.github.com/repos/42BV/rest-convention/languages","stargazers_url":"https://api.github.com/repos/42BV/rest-convention/stargazers","contributors_url":"https://api.github.com/repos/42BV/rest-convention/contributors","subscribers_url":"https://api.github.com/repos/42BV/rest-convention/subscribers","subscription_url":"https://api.github.com/repos/42BV/rest-convention/subscription","commits_url":"https://api.github.com/repos/42BV/rest-convention/commits{/sha}","git_commits_url":"https://api.github.com/repos/42BV/rest-convention/git/commits{/sha}","comments_url":"https://api.github.com/repos/42BV/rest-convention/comments{/number}","issue_comment_url":"https://api.github.com/repos/42BV/rest-convention/issues/comments{/number}","contents_url":"https://api.github.com/repos/42BV/rest-convention/contents/{+path}","compare_url":"https://api.github.com/repos/42BV/rest-convention/compare/{base}...{head}","merges_url":"https://api.github.com/repos/42BV/rest-convention/merges","archive_url":"https://api.github.com/repos/42BV/rest-convention/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/42BV/rest-convention/downloads","issues_url":"https://api.github.com/repos/42BV/rest-convention/issues{/number}","pulls_url":"https://api.github.com/repos/42BV/rest-convention/pulls{/number}","milestones_url":"https://api.github.com/repos/42BV/rest-convention/milestones{/number}","notifications_url":"https://api.github.com/repos/42BV/rest-convention/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/42BV/rest-convention/labels{/name}","releases_url":"https://api.github.com/repos/42BV/rest-convention/releases{/id}","deployments_url":"https://api.github.com/repos/42BV/rest-convention/deployments","created_at":"2016-03-04T11:01:43Z","updated_at":"2016-03-04T11:01:43Z","pushed_at":"2016-03-07T20:09:17Z","git_url":"git://github.com/42BV/rest-convention.git","ssh_url":"git@github.com:42BV/rest-convention.git","clone_url":"https://github.com/42BV/rest-convention.git","svn_url":"https://github.com/42BV/rest-convention","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"42BV:master","ref":"master","sha":"a6c44809a1280460f23d9c8cc98ffea7422adce2","user":{"login":"42BV","id":813733,"avatar_url":"https://avatars.githubusercontent.com/u/813733?v=3","gravatar_id":"","url":"https://api.github.com/users/42BV","html_url":"https://github.com/42BV","followers_url":"https://api.github.com/users/42BV/followers","following_url":"https://api.github.com/users/42BV/following{/other_user}","gists_url":"https://api.github.com/users/42BV/gists{/gist_id}","starred_url":"https://api.github.com/users/42BV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/42BV/subscriptions","organizations_url":"https://api.github.com/users/42BV/orgs","repos_url":"https://api.github.com/users/42BV/repos","events_url":"https://api.github.com/users/42BV/events{/privacy}","received_events_url":"https://api.github.com/users/42BV/received_events","type":"Organization","site_admin":false},"repo":{"id":53129512,"name":"rest-convention","full_name":"42BV/rest-convention","owner":{"login":"42BV","id":813733,"avatar_url":"https://avatars.githubusercontent.com/u/813733?v=3","gravatar_id":"","url":"https://api.github.com/users/42BV","html_url":"https://github.com/42BV","followers_url":"https://api.github.com/users/42BV/followers","following_url":"https://api.github.com/users/42BV/following{/other_user}","gists_url":"https://api.github.com/users/42BV/gists{/gist_id}","starred_url":"https://api.github.com/users/42BV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/42BV/subscriptions","organizations_url":"https://api.github.com/users/42BV/orgs","repos_url":"https://api.github.com/users/42BV/repos","events_url":"https://api.github.com/users/42BV/events{/privacy}","received_events_url":"https://api.github.com/users/42BV/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/42BV/rest-convention","description":"Drafting of the 42 REST Convention","fork":false,"url":"https://api.github.com/repos/42BV/rest-convention","forks_url":"https://api.github.com/repos/42BV/rest-convention/forks","keys_url":"https://api.github.com/repos/42BV/rest-convention/keys{/key_id}","collaborators_url":"https://api.github.com/repos/42BV/rest-convention/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/42BV/rest-convention/teams","hooks_url":"https://api.github.com/repos/42BV/rest-convention/hooks","issue_events_url":"https://api.github.com/repos/42BV/rest-convention/issues/events{/number}","events_url":"https://api.github.com/repos/42BV/rest-convention/events","assignees_url":"https://api.github.com/repos/42BV/rest-convention/assignees{/user}","branches_url":"https://api.github.com/repos/42BV/rest-convention/branches{/branch}","tags_url":"https://api.github.com/repos/42BV/rest-convention/tags","blobs_url":"https://api.github.com/repos/42BV/rest-convention/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/42BV/rest-convention/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/42BV/rest-convention/git/refs{/sha}","trees_url":"https://api.github.com/repos/42BV/rest-convention/git/trees{/sha}","statuses_url":"https://api.github.com/repos/42BV/rest-convention/statuses/{sha}","languages_url":"https://api.github.com/repos/42BV/rest-convention/languages","stargazers_url":"https://api.github.com/repos/42BV/rest-convention/stargazers","contributors_url":"https://api.github.com/repos/42BV/rest-convention/contributors","subscribers_url":"https://api.github.com/repos/42BV/rest-convention/subscribers","subscription_url":"https://api.github.com/repos/42BV/rest-convention/subscription","commits_url":"https://api.github.com/repos/42BV/rest-convention/commits{/sha}","git_commits_url":"https://api.github.com/repos/42BV/rest-convention/git/commits{/sha}","comments_url":"https://api.github.com/repos/42BV/rest-convention/comments{/number}","issue_comment_url":"https://api.github.com/repos/42BV/rest-convention/issues/comments{/number}","contents_url":"https://api.github.com/repos/42BV/rest-convention/contents/{+path}","compare_url":"https://api.github.com/repos/42BV/rest-convention/compare/{base}...{head}","merges_url":"https://api.github.com/repos/42BV/rest-convention/merges","archive_url":"https://api.github.com/repos/42BV/rest-convention/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/42BV/rest-convention/downloads","issues_url":"https://api.github.com/repos/42BV/rest-convention/issues{/number}","pulls_url":"https://api.github.com/repos/42BV/rest-convention/pulls{/number}","milestones_url":"https://api.github.com/repos/42BV/rest-convention/milestones{/number}","notifications_url":"https://api.github.com/repos/42BV/rest-convention/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/42BV/rest-convention/labels{/name}","releases_url":"https://api.github.com/repos/42BV/rest-convention/releases{/id}","deployments_url":"https://api.github.com/repos/42BV/rest-convention/deployments","created_at":"2016-03-04T11:01:43Z","updated_at":"2016-03-04T11:01:43Z","pushed_at":"2016-03-07T20:09:17Z","git_url":"git://github.com/42BV/rest-convention.git","ssh_url":"git@github.com:42BV/rest-convention.git","clone_url":"https://github.com/42BV/rest-convention.git","svn_url":"https://github.com/42BV/rest-convention","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/1"},"html":{"href":"https://github.com/42BV/rest-convention/pull/1"},"issue":{"href":"https://api.github.com/repos/42BV/rest-convention/issues/1"},"comments":{"href":"https://api.github.com/repos/42BV/rest-convention/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/42BV/rest-convention/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/42BV/rest-convention/statuses/f9b12829644e6cea8f7658e3fff745f82c0db9f4"}}}}