Last active
May 17, 2018 12:54
-
-
Save sumitasok/202ee843ba8b94a9a2c16d4cef1a614e to your computer and use it in GitHub Desktop.
Snippet to fake a web response for testing the response.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
req = RestClient::Request.new(url: "www.google.com", method: 'get') | |
net_http_resp = Net::HTTPResponse.new(1.0, 200, "OK") | |
net_http_resp.add_field 'Set-Cookie', 'Monster' | |
resp = RestClient::Response.create(response_body.to_json, net_http_resp, req) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment