{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/takes/issues/379","labels_url":"https://api.github.com/repos/yegor256/takes/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/379/comments","events_url":"https://api.github.com/repos/yegor256/takes/issues/379/events","html_url":"https://github.com/yegor256/takes/issues/379","id":103767857,"number":379,"title":"RsWithStatus() with no body can cause IOException.","user":{"login":"alxn","id":4368287,"avatar_url":"https://avatars.githubusercontent.com/u/4368287?v=3","gravatar_id":"","url":"https://api.github.com/users/alxn","html_url":"https://github.com/alxn","followers_url":"https://api.github.com/users/alxn/followers","following_url":"https://api.github.com/users/alxn/following{/other_user}","gists_url":"https://api.github.com/users/alxn/gists{/gist_id}","starred_url":"https://api.github.com/users/alxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxn/subscriptions","organizations_url":"https://api.github.com/users/alxn/orgs","repos_url":"https://api.github.com/users/alxn/repos","events_url":"https://api.github.com/users/alxn/events{/privacy}","received_events_url":"https://api.github.com/users/alxn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/takes/labels/30%20mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/yegor256/takes/labels/@mstzn36","name":"@mstzn36","color":"009801"},{"url":"https://api.github.com/repos/yegor256/takes/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/yegor256/takes/labels/DEV","name":"DEV","color":"bfd4f3"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yegor256/takes/milestones/1","html_url":"https://github.com/yegor256/takes/milestones/1.0","labels_url":"https://api.github.com/repos/yegor256/takes/milestones/1/labels","id":1069705,"number":1,"title":"1.0","description":"first fully working version","creator":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":84,"state":"open","created_at":"2015-04-16T00:55:10Z","updated_at":"2015-08-30T20:15:05Z","due_on":"2015-05-14T07:00:00Z","closed_at":null},"comments":5,"created_at":"2015-08-28T18:03:51Z","updated_at":"2015-08-31T20:56:20Z","closed_at":null,"body":"I was trying to use the following in a `TkFork` on a `PUT`:\r\n\r\n```java\r\nnew TkRegex() {\r\n    @Override\r\n    public Response act(final RqRegex req) {\r\n        return new RsWithStatus(\r\n            HttpURLConnection.HTTP_OK\r\n        );\r\n    }\r\n}\r\n```\r\nBut when I ran it in a live system I saw:\r\n\r\n```java\r\nCaused by: java.io.IOException: Failed PUT request to http://localhost:6001/path\r\n       at com.jcabi.http.request.JdkRequest$1.send(JdkRequest.java:127)\r\n       at com.jcabi.http.request.BaseRequest.fetchResponse(BaseRequest.java:297)\r\n       at com.jcabi.http.request.BaseRequest.fetch(BaseRequest.java:212)\r\n       ... 20 more\r\nCaused by: java.net.SocketException: Connection reset\r\n       at java.net.SocketInputStream.read(SocketInputStream.java:196)\r\n       at java.net.SocketInputStream.read(SocketInputStream.java:122)\r\n       at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)\r\n       at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)\r\n       at java.io.BufferedInputStream.read(BufferedInputStream.java:334)\r\n       at java.io.FilterInputStream.read(FilterInputStream.java:133)\r\n       at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3066)\r\n       at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3060)\r\n       at com.jcabi.http.request.JdkRequest$1.body(JdkRequest.java:192)\r\n       at com.jcabi.http.request.JdkRequest$1.send(JdkRequest.java:119)\r\n       ... 22 more\r\n```\r\n\r\nThat was odd.. since I saw the request-response go through with `ngrep`.\r\n\r\nChanging the code to:\r\n\r\n```java\r\nnew TkRegex() {\r\n   @Override\r\n   public Response act(final RqRegex req) {\r\n       return new RsWithStatus(\r\n           new RsText(\"hello\"),\r\n           HttpURLConnection.HTTP_OK\r\n       );\r\n   }\r\n}\r\n```\r\n\r\nMade it work without exception, but obviously it should work without a\r\nbody.\r\n"},"comment":{"url":"https://api.github.com/repos/yegor256/takes/issues/comments/136496878","html_url":"https://github.com/yegor256/takes/issues/379#issuecomment-136496878","issue_url":"https://api.github.com/repos/yegor256/takes/issues/379","id":136496878,"user":{"login":"mstzn36","id":6291471,"avatar_url":"https://avatars.githubusercontent.com/u/6291471?v=3","gravatar_id":"","url":"https://api.github.com/users/mstzn36","html_url":"https://github.com/mstzn36","followers_url":"https://api.github.com/users/mstzn36/followers","following_url":"https://api.github.com/users/mstzn36/following{/other_user}","gists_url":"https://api.github.com/users/mstzn36/gists{/gist_id}","starred_url":"https://api.github.com/users/mstzn36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstzn36/subscriptions","organizations_url":"https://api.github.com/users/mstzn36/orgs","repos_url":"https://api.github.com/users/mstzn36/repos","events_url":"https://api.github.com/users/mstzn36/events{/privacy}","received_events_url":"https://api.github.com/users/mstzn36/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T20:56:20Z","updated_at":"2015-08-31T20:56:20Z","body":"@alxn can you provide me full of code block if you have? Thank you."}}