{"action":"created","issue":{"url":"https://api.github.com/repos/basti1302/traverson/issues/24","labels_url":"https://api.github.com/repos/basti1302/traverson/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/basti1302/traverson/issues/24/comments","events_url":"https://api.github.com/repos/basti1302/traverson/issues/24/events","html_url":"https://github.com/basti1302/traverson/issues/24","id":51443522,"number":24,"title":"How to deal with linked forms?","user":{"login":"ashic","id":565991,"avatar_url":"https://avatars.githubusercontent.com/u/565991?v=3","gravatar_id":"","url":"https://api.github.com/users/ashic","html_url":"https://github.com/ashic","followers_url":"https://api.github.com/users/ashic/followers","following_url":"https://api.github.com/users/ashic/following{/other_user}","gists_url":"https://api.github.com/users/ashic/gists{/gist_id}","starred_url":"https://api.github.com/users/ashic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashic/subscriptions","organizations_url":"https://api.github.com/users/ashic/orgs","repos_url":"https://api.github.com/users/ashic/repos","events_url":"https://api.github.com/users/ashic/events{/privacy}","received_events_url":"https://api.github.com/users/ashic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-09T15:51:41Z","updated_at":"2015-04-07T22:47:51Z","closed_at":"2015-04-07T22:47:51Z","body":"I'm looking into Traverson (looks awesome), and have run into an issue that I can't figure out how to solve.\r\n\r\nSay, we have a resource that's a form with links to submit. Let's say, /api/doggies/registration-form gives us this:\r\n\r\n{ name: '', age:'', site_zone: 'uk', _links : {'self': /api/doggies/registration-form }}\r\n\r\nWe've got this resource via:\r\nvar api = traverson.jsonHal.from('/api');\r\napi.newRequest().withRequestOptions(...).follow('doggies', 'registration-form').getResource(\r\n    function(e, doc) {\r\n       //the json above is in doc.\r\n    }\r\n)\r\n\r\nNow doc is a representation of the registration form. It has two values the client needs to fill in (name and age), and another that is relevant to the server and should be copied over verbatim in the submitted data. The \"doc\" is json that's essentially the new resource. It's got a link to post to, and data payload that the client should update before posting.\r\n\r\nWithout creating a new traverson.jsonHAL.from(theSelfLink), is there a way I can take the \"doc\", update the values, and post? Perhaps what I'm looking for is in the lines of:\r\n\r\n var api = traverson.jsonHal.from('/api');\r\napi.newRequest().withRequestOptions(...).follow('doggies', 'registration-form').getResource(\r\n    function(e, doc) {\r\n       //the json above is in doc.\r\n         doc.name = \"Scooby\";\r\n         doc.age = 11;\r\n         doc.post(\"self\", function(err, res){}); // or something.post(doc, \"self\")\r\n    }\r\n)\r\n\r\nThe emphasis here being that we need to be able to take a server generated form, update the fields we care about, but submit the whole thing so the server is free to add fields in the future.\r\n\r\nIf we could simply take some json and create a traverson resource, this should \"just work\". How can we do that?"},"comment":{"url":"https://api.github.com/repos/basti1302/traverson/issues/comments/90752156","html_url":"https://github.com/basti1302/traverson/issues/24#issuecomment-90752156","issue_url":"https://api.github.com/repos/basti1302/traverson/issues/24","id":90752156,"user":{"login":"basti1302","id":73801,"avatar_url":"https://avatars.githubusercontent.com/u/73801?v=3","gravatar_id":"","url":"https://api.github.com/users/basti1302","html_url":"https://github.com/basti1302","followers_url":"https://api.github.com/users/basti1302/followers","following_url":"https://api.github.com/users/basti1302/following{/other_user}","gists_url":"https://api.github.com/users/basti1302/gists{/gist_id}","starred_url":"https://api.github.com/users/basti1302/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basti1302/subscriptions","organizations_url":"https://api.github.com/users/basti1302/orgs","repos_url":"https://api.github.com/users/basti1302/repos","events_url":"https://api.github.com/users/basti1302/events{/privacy}","received_events_url":"https://api.github.com/users/basti1302/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T22:47:50Z","updated_at":"2015-04-07T22:47:50Z","body":"Continuing link traversals has landed in 2.0.0, which should also enable the use case described in this issue."}}