{"action":"created","comment":{"url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/comments/27333801","id":27333801,"diff_hunk":"@@ -1,2 +1,724 @@\n-# purescript-affjax\n-An asynchronous AJAX library built using Aff.\n+# Module Documentation\n+\n+## Module Network.HTTP.Affjax\n+\n+#### `Ajax`\n+\n+``` purescript\n+data Ajax :: !\n+```\n+\n+The effect type for AJAX requests made with Affjax.\n+\n+#### `Affjax`\n+\n+``` purescript\n+type Affjax e a = Aff (ajax :: Ajax | e) (AffjaxResponse a)\n+```\n+\n+The type for Affjax requests.\n+\n+#### `AffjaxOptions`\n+\n+``` purescript\n+data AffjaxOptions :: *\n+```\n+\n+Options type for Affjax requests.\n+\n+#### `AffjaxResponse`\n+\n+``` purescript\n+type AffjaxResponse a = { response :: a, headers :: [ResponseHeader], status :: StatusCode }\n+```\n+\n+The type of records that will be received as an Affjax response.\n+\n+#### `url`\n+\n+``` purescript\n+url :: Option AffjaxOptions String\n+```\n+\n+Sets the URL for a request.\n+\n+#### `method`\n+\n+``` purescript\n+method :: Option AffjaxOptions Method\n+```\n+\n+Sets the HTTP method for a request.\n+\n+#### `content`\n+\n+``` purescript\n+content :: Option AffjaxOptions RequestContent\n+```\n+\n+Sets the content to send in a request.\n+\n+#### `headers`\n+\n+``` purescript\n+headers :: Option AffjaxOptions [RequestHeader]\n+```\n+\n+Sets the headers to send with a request.\n+\n+#### `username`\n+\n+``` purescript\n+username :: Option AffjaxOptions String\n+```\n+\n+Sets the HTTP auth username to send with a request.\n+\n+#### `password`\n+\n+``` purescript\n+password :: Option AffjaxOptions String\n+```\n+\n+Sets the HTTP auth password to send with a request.\n+\n+#### `affjax`\n+\n+``` purescript\n+affjax :: forall e a. Responsable a -> Options AffjaxOptions -> Affjax e a\n+```\n+\n+Runs a request.\n+\n+#### `affjax'`\n+\n+``` purescript\n+affjax' :: forall e a. Responsable a -> Options AffjaxOptions -> (Error -> Eff (ajax :: Ajax | e) Unit) -> (AffjaxResponse a -> Eff (ajax :: Ajax | e) Unit) -> Eff (ajax :: Ajax | e) Unit\n+```\n+\n+Runs a request directly in Eff.\n+\n+#### `get`\n+\n+``` purescript\n+get :: forall e a. Responsable a -> String -> Affjax e a\n+```\n+\n+\n+#### `post`\n+\n+``` purescript\n+post :: forall e a. Responsable a -> String -> RequestContent -> Affjax e a\n+```\n+\n+\n+#### `post_`\n+\n+``` purescript\n+post_ :: forall e. String -> RequestContent -> Affjax e Unit\n+```\n+\n+\n+#### `put`\n+\n+``` purescript\n+put :: forall e a. Responsable a -> String -> RequestContent -> Affjax e a\n+```\n+\n+\n+#### `put_`\n+\n+``` purescript\n+put_ :: forall e. String -> RequestContent -> Affjax e Unit\n+```\n+\n+\n+#### `delete`\n+\n+``` purescript\n+delete :: forall e a. Responsable a -> String -> Affjax e a\n+```\n+\n+\n+#### `delete_`\n+\n+``` purescript\n+delete_ :: forall e. String -> Affjax e Unit\n+```\n+\n+\n+\n+## Module Network.HTTP.Method\n+\n+#### `Method`\n+\n+``` purescript\n+data Method\n+  = DELETE \n+  | GET \n+  | HEAD \n+  | OPTIONS \n+  | PATCH \n+  | POST \n+  | PUT ","path":"README.md","position":165,"original_position":165,"commit_id":"18c06084ea7591ea904d67482c45c5597b47a9d3","original_commit_id":"18c06084ea7591ea904d67482c45c5597b47a9d3","user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"body":"Is there one for `RENAME`? I've only been able to find info about `MOVE` and `COPY`.","created_at":"2015-03-27T21:53:29Z","updated_at":"2015-03-27T21:53:29Z","html_url":"https://github.com/slamdata/purescript-affjax/pull/3#discussion_r27333801","pull_request_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/comments/27333801"},"html":{"href":"https://github.com/slamdata/purescript-affjax/pull/3#discussion_r27333801"},"pull_request":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3","id":31974828,"html_url":"https://github.com/slamdata/purescript-affjax/pull/3","diff_url":"https://github.com/slamdata/purescript-affjax/pull/3.diff","patch_url":"https://github.com/slamdata/purescript-affjax/pull/3.patch","issue_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/3","number":3,"state":"open","locked":false,"title":"`Options` based approach","user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"body":"Resolves #1 (maybe!)\r\n\r\n- The free monad is gone in favour of using `options`.\r\n- We now have `Requestable` and `Responsable` classes to deal with conversions of values.\r\n  - The XHR `contentType` property is set based on the expected `Responsable` value.\r\n  - I still need to do some work with handling the \"default\" XHR response values as it's all very unsafe right now, I need to figure out a problem I'm having with `ArrayBuffers` being sent across not coming through with the right length.\r\n  - One disadvantage of this approach is now response values must be explicitly typed or used so they are unified with a type to prevent a `No instance for Responsable uXXXX` error.\r\n- I need to make simple `get`, `post`, etc. combinators.\r\n- We may still want a free monad type thing anyway, as with this `options` version the headers have to be all set together.\r\n- I need to switch over to `mandragora-bucket` and integrate the tests into the gulp build.\r\n- `unsafeAjax`'s callback should actually be `AffjaxResponse Foreign -> Eff (ajax :: Ajax | e) Unit` and then `affjax'` should `read`/`fromContent` the value to actually make it into a `Responsable b`, handling errors somehow.","created_at":"2015-03-25T23:01:05Z","updated_at":"2015-03-27T21:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d1e3901d12acc6246df23f4fbe149748a723aef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3/commits","review_comments_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3/comments","review_comment_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/3/comments","statuses_url":"https://api.github.com/repos/slamdata/purescript-affjax/statuses/18c06084ea7591ea904d67482c45c5597b47a9d3","head":{"label":"slamdata:options","ref":"options","sha":"18c06084ea7591ea904d67482c45c5597b47a9d3","user":{"login":"slamdata","id":5385602,"avatar_url":"https://avatars.githubusercontent.com/u/5385602?v=3","gravatar_id":"","url":"https://api.github.com/users/slamdata","html_url":"https://github.com/slamdata","followers_url":"https://api.github.com/users/slamdata/followers","following_url":"https://api.github.com/users/slamdata/following{/other_user}","gists_url":"https://api.github.com/users/slamdata/gists{/gist_id}","starred_url":"https://api.github.com/users/slamdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slamdata/subscriptions","organizations_url":"https://api.github.com/users/slamdata/orgs","repos_url":"https://api.github.com/users/slamdata/repos","events_url":"https://api.github.com/users/slamdata/events{/privacy}","received_events_url":"https://api.github.com/users/slamdata/received_events","type":"Organization","site_admin":false},"repo":{"id":31869505,"name":"purescript-affjax","full_name":"slamdata/purescript-affjax","owner":{"login":"slamdata","id":5385602,"avatar_url":"https://avatars.githubusercontent.com/u/5385602?v=3","gravatar_id":"","url":"https://api.github.com/users/slamdata","html_url":"https://github.com/slamdata","followers_url":"https://api.github.com/users/slamdata/followers","following_url":"https://api.github.com/users/slamdata/following{/other_user}","gists_url":"https://api.github.com/users/slamdata/gists{/gist_id}","starred_url":"https://api.github.com/users/slamdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slamdata/subscriptions","organizations_url":"https://api.github.com/users/slamdata/orgs","repos_url":"https://api.github.com/users/slamdata/repos","events_url":"https://api.github.com/users/slamdata/events{/privacy}","received_events_url":"https://api.github.com/users/slamdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slamdata/purescript-affjax","description":"An asynchronous AJAX library built using Aff.","fork":false,"url":"https://api.github.com/repos/slamdata/purescript-affjax","forks_url":"https://api.github.com/repos/slamdata/purescript-affjax/forks","keys_url":"https://api.github.com/repos/slamdata/purescript-affjax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slamdata/purescript-affjax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slamdata/purescript-affjax/teams","hooks_url":"https://api.github.com/repos/slamdata/purescript-affjax/hooks","issue_events_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/events{/number}","events_url":"https://api.github.com/repos/slamdata/purescript-affjax/events","assignees_url":"https://api.github.com/repos/slamdata/purescript-affjax/assignees{/user}","branches_url":"https://api.github.com/repos/slamdata/purescript-affjax/branches{/branch}","tags_url":"https://api.github.com/repos/slamdata/purescript-affjax/tags","blobs_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/refs{/sha}","trees_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slamdata/purescript-affjax/statuses/{sha}","languages_url":"https://api.github.com/repos/slamdata/purescript-affjax/languages","stargazers_url":"https://api.github.com/repos/slamdata/purescript-affjax/stargazers","contributors_url":"https://api.github.com/repos/slamdata/purescript-affjax/contributors","subscribers_url":"https://api.github.com/repos/slamdata/purescript-affjax/subscribers","subscription_url":"https://api.github.com/repos/slamdata/purescript-affjax/subscription","commits_url":"https://api.github.com/repos/slamdata/purescript-affjax/commits{/sha}","git_commits_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/commits{/sha}","comments_url":"https://api.github.com/repos/slamdata/purescript-affjax/comments{/number}","issue_comment_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/comments{/number}","contents_url":"https://api.github.com/repos/slamdata/purescript-affjax/contents/{+path}","compare_url":"https://api.github.com/repos/slamdata/purescript-affjax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slamdata/purescript-affjax/merges","archive_url":"https://api.github.com/repos/slamdata/purescript-affjax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slamdata/purescript-affjax/downloads","issues_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues{/number}","pulls_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls{/number}","milestones_url":"https://api.github.com/repos/slamdata/purescript-affjax/milestones{/number}","notifications_url":"https://api.github.com/repos/slamdata/purescript-affjax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slamdata/purescript-affjax/labels{/name}","releases_url":"https://api.github.com/repos/slamdata/purescript-affjax/releases{/id}","created_at":"2015-03-08T23:07:48Z","updated_at":"2015-03-23T19:24:54Z","pushed_at":"2015-03-27T01:12:48Z","git_url":"git://github.com/slamdata/purescript-affjax.git","ssh_url":"git@github.com:slamdata/purescript-affjax.git","clone_url":"https://github.com/slamdata/purescript-affjax.git","svn_url":"https://github.com/slamdata/purescript-affjax","homepage":null,"size":196,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"slamdata:master","ref":"master","sha":"627c90fd1c2d8bac35c0e2d1308c7ae5a2a29dca","user":{"login":"slamdata","id":5385602,"avatar_url":"https://avatars.githubusercontent.com/u/5385602?v=3","gravatar_id":"","url":"https://api.github.com/users/slamdata","html_url":"https://github.com/slamdata","followers_url":"https://api.github.com/users/slamdata/followers","following_url":"https://api.github.com/users/slamdata/following{/other_user}","gists_url":"https://api.github.com/users/slamdata/gists{/gist_id}","starred_url":"https://api.github.com/users/slamdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slamdata/subscriptions","organizations_url":"https://api.github.com/users/slamdata/orgs","repos_url":"https://api.github.com/users/slamdata/repos","events_url":"https://api.github.com/users/slamdata/events{/privacy}","received_events_url":"https://api.github.com/users/slamdata/received_events","type":"Organization","site_admin":false},"repo":{"id":31869505,"name":"purescript-affjax","full_name":"slamdata/purescript-affjax","owner":{"login":"slamdata","id":5385602,"avatar_url":"https://avatars.githubusercontent.com/u/5385602?v=3","gravatar_id":"","url":"https://api.github.com/users/slamdata","html_url":"https://github.com/slamdata","followers_url":"https://api.github.com/users/slamdata/followers","following_url":"https://api.github.com/users/slamdata/following{/other_user}","gists_url":"https://api.github.com/users/slamdata/gists{/gist_id}","starred_url":"https://api.github.com/users/slamdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slamdata/subscriptions","organizations_url":"https://api.github.com/users/slamdata/orgs","repos_url":"https://api.github.com/users/slamdata/repos","events_url":"https://api.github.com/users/slamdata/events{/privacy}","received_events_url":"https://api.github.com/users/slamdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slamdata/purescript-affjax","description":"An asynchronous AJAX library built using Aff.","fork":false,"url":"https://api.github.com/repos/slamdata/purescript-affjax","forks_url":"https://api.github.com/repos/slamdata/purescript-affjax/forks","keys_url":"https://api.github.com/repos/slamdata/purescript-affjax/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slamdata/purescript-affjax/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slamdata/purescript-affjax/teams","hooks_url":"https://api.github.com/repos/slamdata/purescript-affjax/hooks","issue_events_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/events{/number}","events_url":"https://api.github.com/repos/slamdata/purescript-affjax/events","assignees_url":"https://api.github.com/repos/slamdata/purescript-affjax/assignees{/user}","branches_url":"https://api.github.com/repos/slamdata/purescript-affjax/branches{/branch}","tags_url":"https://api.github.com/repos/slamdata/purescript-affjax/tags","blobs_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/refs{/sha}","trees_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slamdata/purescript-affjax/statuses/{sha}","languages_url":"https://api.github.com/repos/slamdata/purescript-affjax/languages","stargazers_url":"https://api.github.com/repos/slamdata/purescript-affjax/stargazers","contributors_url":"https://api.github.com/repos/slamdata/purescript-affjax/contributors","subscribers_url":"https://api.github.com/repos/slamdata/purescript-affjax/subscribers","subscription_url":"https://api.github.com/repos/slamdata/purescript-affjax/subscription","commits_url":"https://api.github.com/repos/slamdata/purescript-affjax/commits{/sha}","git_commits_url":"https://api.github.com/repos/slamdata/purescript-affjax/git/commits{/sha}","comments_url":"https://api.github.com/repos/slamdata/purescript-affjax/comments{/number}","issue_comment_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues/comments{/number}","contents_url":"https://api.github.com/repos/slamdata/purescript-affjax/contents/{+path}","compare_url":"https://api.github.com/repos/slamdata/purescript-affjax/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slamdata/purescript-affjax/merges","archive_url":"https://api.github.com/repos/slamdata/purescript-affjax/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slamdata/purescript-affjax/downloads","issues_url":"https://api.github.com/repos/slamdata/purescript-affjax/issues{/number}","pulls_url":"https://api.github.com/repos/slamdata/purescript-affjax/pulls{/number}","milestones_url":"https://api.github.com/repos/slamdata/purescript-affjax/milestones{/number}","notifications_url":"https://api.github.com/repos/slamdata/purescript-affjax/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slamdata/purescript-affjax/labels{/name}","releases_url":"https://api.github.com/repos/slamdata/purescript-affjax/releases{/id}","created_at":"2015-03-08T23:07:48Z","updated_at":"2015-03-23T19:24:54Z","pushed_at":"2015-03-27T01:12:48Z","git_url":"git://github.com/slamdata/purescript-affjax.git","ssh_url":"git@github.com:slamdata/purescript-affjax.git","clone_url":"https://github.com/slamdata/purescript-affjax.git","svn_url":"https://github.com/slamdata/purescript-affjax","homepage":null,"size":196,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3"},"html":{"href":"https://github.com/slamdata/purescript-affjax/pull/3"},"issue":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/issues/3"},"comments":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/slamdata/purescript-affjax/statuses/18c06084ea7591ea904d67482c45c5597b47a9d3"}}}}