{"action":"created","issue":{"url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/287","repository_url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer","labels_url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/287/labels{/name}","comments_url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/287/comments","events_url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/287/events","html_url":"https://github.com/me-no-dev/ESPAsyncWebServer/pull/287","id":275013010,"node_id":"MDExOlB1bGxSZXF1ZXN0MTUzNDA2NDUy","number":287,"title":"Added handler for correct JSON deserialization, addresses #195","user":{"login":"avonwyss","id":1014766,"node_id":"MDQ6VXNlcjEwMTQ3NjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1014766?v=4","gravatar_id":"","url":"https://api.github.com/users/avonwyss","html_url":"https://github.com/avonwyss","followers_url":"https://api.github.com/users/avonwyss/followers","following_url":"https://api.github.com/users/avonwyss/following{/other_user}","gists_url":"https://api.github.com/users/avonwyss/gists{/gist_id}","starred_url":"https://api.github.com/users/avonwyss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avonwyss/subscriptions","organizations_url":"https://api.github.com/users/avonwyss/orgs","repos_url":"https://api.github.com/users/avonwyss/repos","events_url":"https://api.github.com/users/avonwyss/events{/privacy}","received_events_url":"https://api.github.com/users/avonwyss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-11-17T22:17:18Z","updated_at":"2018-07-24T18:53:34Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/pulls/287","html_url":"https://github.com/me-no-dev/ESPAsyncWebServer/pull/287","diff_url":"https://github.com/me-no-dev/ESPAsyncWebServer/pull/287.diff","patch_url":"https://github.com/me-no-dev/ESPAsyncWebServer/pull/287.patch"},"body":"While searching for a proper solution to handle POST JSON requests I have found different answers but none seemed to be right (some not working at all) and in line with the async approach. All of the ones I found do their processing in the `onRequestBody` handler (either on the server or as argument in the callback handler), but this approach is not a good one:\r\n\r\n- If the JSON data does not come in all at once (e.g. in one call to `onRequestBody`), the code will terribly break.\r\n- There is no way how the data being processed in the `onRequestBody` can be associated (and managed) across multiple calls, or to pass the data along to `handleRequest`. This makes it impossible to properly deal with the data.\r\n\r\nMy take is to implement a generic JSON handler `AsyncCallbackJsonWebHandler` which follows the same pattern as the `AsyncCallbackWebHandler`, but does not expose file and body handling as callbacks but rather handles them. The `handleRequest` function receives a `JsonVariant` reference without the need to manually parse anything. Invalid requests, or requests exceeding the allowed content length, are rejected gracefully."},"comment":{"url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/comments/407514373","html_url":"https://github.com/me-no-dev/ESPAsyncWebServer/pull/287#issuecomment-407514373","issue_url":"https://api.github.com/repos/me-no-dev/ESPAsyncWebServer/issues/287","id":407514373,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzUxNDM3Mw==","user":{"login":"me-no-dev","id":12663778,"node_id":"MDQ6VXNlcjEyNjYzNzc4","avatar_url":"https://avatars3.githubusercontent.com/u/12663778?v=4","gravatar_id":"","url":"https://api.github.com/users/me-no-dev","html_url":"https://github.com/me-no-dev","followers_url":"https://api.github.com/users/me-no-dev/followers","following_url":"https://api.github.com/users/me-no-dev/following{/other_user}","gists_url":"https://api.github.com/users/me-no-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/me-no-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/me-no-dev/subscriptions","organizations_url":"https://api.github.com/users/me-no-dev/orgs","repos_url":"https://api.github.com/users/me-no-dev/repos","events_url":"https://api.github.com/users/me-no-dev/events{/privacy}","received_events_url":"https://api.github.com/users/me-no-dev/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T18:53:34Z","updated_at":"2018-07-24T18:53:34Z","author_association":"OWNER","body":"Totally my fault. Have been overwhelmed by work and the fact that I moved to another country... merging as soon as travis is done testing"}}
{"actor":{"display_login":"me-no-dev"}}