cucumber-api
cucumber-api copied to clipboard
POST with json file
Hi, When I send a POST request with a json file in a given path, json file is parsed as hash, that causes problem at RestClient side.
You need to modify @body with @body.to_json , otherwise it returns 415 as response code
when 'json' @body = JSON.parse File.read(path) **@body = @body.to_json** else
Hi wanna send a PR? I'll merge soon as I can :)
Also encountering this same issue. You can also fix it by:
@body = JSON.dump(JSON.parse File.read(path))