{"action":"created","issue":{"url":"https://api.github.com/repos/rest-assured/rest-assured/issues/674","repository_url":"https://api.github.com/repos/rest-assured/rest-assured","labels_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/674/comments","events_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/674/events","html_url":"https://github.com/rest-assured/rest-assured/issues/674","id":148439900,"number":674,"title":"using a Json file in Rest-assured for payload","user":{"login":"bhaskarHub","id":12846008,"avatar_url":"https://avatars0.githubusercontent.com/u/12846008?v=4","gravatar_id":"","url":"https://api.github.com/users/bhaskarHub","html_url":"https://github.com/bhaskarHub","followers_url":"https://api.github.com/users/bhaskarHub/followers","following_url":"https://api.github.com/users/bhaskarHub/following{/other_user}","gists_url":"https://api.github.com/users/bhaskarHub/gists{/gist_id}","starred_url":"https://api.github.com/users/bhaskarHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhaskarHub/subscriptions","organizations_url":"https://api.github.com/users/bhaskarHub/orgs","repos_url":"https://api.github.com/users/bhaskarHub/repos","events_url":"https://api.github.com/users/bhaskarHub/events{/privacy}","received_events_url":"https://api.github.com/users/bhaskarHub/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-04-14T18:08:09Z","updated_at":"2017-09-23T01:12:29Z","closed_at":"2016-04-15T15:27:15Z","author_association":"NONE","body":" I have a  JSON file to be POST as payload for a rest api call for testing purposes. I tried something like :\n\n```\n    public void RestTest() throws Exception {\n    File file = new File(\"/Users/bmishra/Code_Center/stash/experiments/src/main/resources/Search.json\");\n    String content = null;\n\n    given().body(file).with().contentType(\"application/json\").then().expect().\n            statusCode(200).\n            body(equalTo(\"true\")).when().post(\"http://devsearch\");\n\n\n}\n```\n\nand get error as :\n\n`java.lang.UnsupportedOperationException: Internal error: Can't encode /Users/bmishra/Code_Center/stash/experiments/src/main/resources/Search.json to JSON.`\n\nI can run by reading the file and passing the body as string and that works but I see i can directly pass the file object and this doesn't work.\n"},"comment":{"url":"https://api.github.com/repos/rest-assured/rest-assured/issues/comments/331595730","html_url":"https://github.com/rest-assured/rest-assured/issues/674#issuecomment-331595730","issue_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/674","id":331595730,"user":{"login":"Styris","id":31900819,"avatar_url":"https://avatars1.githubusercontent.com/u/31900819?v=4","gravatar_id":"","url":"https://api.github.com/users/Styris","html_url":"https://github.com/Styris","followers_url":"https://api.github.com/users/Styris/followers","following_url":"https://api.github.com/users/Styris/following{/other_user}","gists_url":"https://api.github.com/users/Styris/gists{/gist_id}","starred_url":"https://api.github.com/users/Styris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Styris/subscriptions","organizations_url":"https://api.github.com/users/Styris/orgs","repos_url":"https://api.github.com/users/Styris/repos","events_url":"https://api.github.com/users/Styris/events{/privacy}","received_events_url":"https://api.github.com/users/Styris/received_events","type":"User","site_admin":false},"created_at":"2017-09-23T01:12:29Z","updated_at":"2017-09-23T01:12:29Z","author_association":"NONE","body":"@johanhaleby @bhaskarHub I added this to my pom.xml\r\n<repositories>\r\n        <repository>\r\n            <id>sonatype</id>\r\n            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>\r\n            <snapshots />\r\n        </repository>\r\n</repositories>\r\n\r\nCould you please paste what else I need to paste in the pom.xml (dependency?) to make this work.\r\nThanks!\r\n"}}
{"actor":{"display_login":"Styris"}}