{"action":"created","issue":{"url":"https://api.github.com/repos/morepath/morepath/issues/509","repository_url":"https://api.github.com/repos/morepath/morepath","labels_url":"https://api.github.com/repos/morepath/morepath/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/morepath/morepath/issues/509/comments","events_url":"https://api.github.com/repos/morepath/morepath/issues/509/events","html_url":"https://github.com/morepath/morepath/issues/509","id":197739852,"number":509,"title":"Preserving request data across a redirect","user":{"login":"gmc444-b","id":21226719,"avatar_url":"https://avatars.githubusercontent.com/u/21226719?v=3","gravatar_id":"","url":"https://api.github.com/users/gmc444-b","html_url":"https://github.com/gmc444-b","followers_url":"https://api.github.com/users/gmc444-b/followers","following_url":"https://api.github.com/users/gmc444-b/following{/other_user}","gists_url":"https://api.github.com/users/gmc444-b/gists{/gist_id}","starred_url":"https://api.github.com/users/gmc444-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmc444-b/subscriptions","organizations_url":"https://api.github.com/users/gmc444-b/orgs","repos_url":"https://api.github.com/users/gmc444-b/repos","events_url":"https://api.github.com/users/gmc444-b/events{/privacy}","received_events_url":"https://api.github.com/users/gmc444-b/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-27T18:21:12Z","updated_at":"2016-12-29T19:40:55Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to use morepath with some legacy services within my company. Their http protocol uses a single URL for a service (the service name) and everything else is in the payload in JSON. For example, the JSON for a request for a customer record would look like:\r\n   { 'GetCustomer' : { 'id' : 123456 } }\r\nand the JSON for submitting a customer record would look like:\r\n  { 'SetCustomer' : { 'id' : 234567, 'name' : 'FavoredCustomer' } }\r\n\r\nI'd like to handle this by redirecting the request to a path that handles the named type. The problem I encounter is that the redirect causes a new request to be formulated, formatted as a GET, and the payload is lost. I could formulate the redirect to contain all the data as variables in the URI, but the payloads could be large, with a complex structure that would be difficult to translate. \r\n\r\nHow would I go about performing the redirect in a way that preserves the body of the request?\r\n\r\nThanks,\r\n\r\nGreg\r\n"},"comment":{"url":"https://api.github.com/repos/morepath/morepath/issues/comments/269682207","html_url":"https://github.com/morepath/morepath/issues/509#issuecomment-269682207","issue_url":"https://api.github.com/repos/morepath/morepath/issues/509","id":269682207,"user":{"login":"gmc444-b","id":21226719,"avatar_url":"https://avatars.githubusercontent.com/u/21226719?v=3","gravatar_id":"","url":"https://api.github.com/users/gmc444-b","html_url":"https://github.com/gmc444-b","followers_url":"https://api.github.com/users/gmc444-b/followers","following_url":"https://api.github.com/users/gmc444-b/following{/other_user}","gists_url":"https://api.github.com/users/gmc444-b/gists{/gist_id}","starred_url":"https://api.github.com/users/gmc444-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmc444-b/subscriptions","organizations_url":"https://api.github.com/users/gmc444-b/orgs","repos_url":"https://api.github.com/users/gmc444-b/repos","events_url":"https://api.github.com/users/gmc444-b/events{/privacy}","received_events_url":"https://api.github.com/users/gmc444-b/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T19:40:55Z","updated_at":"2016-12-29T19:40:55Z","body":"Your understanding is better than mine, actually. I did not realize that the redirect was going back to the client until I read your description and verified that this was happening.\r\n\r\nI would like to dispatch the request to the appropriate control logic using the information in the POST, entirely on the server side. For example, if I have:\r\n\r\n    @App.path(model=GetCustomer, path='getcustomer')\r\n    def get_customer():\r\n         ...\r\nI'd like the framework to take care of making the connection and perform the rerouting based on the JSON data. \r\n\r\nDoes that make sense?\r\n\r\n"}}
{"actor":{"display_login":"gmc444-b"}}