Last active
December 13, 2022 06:52
-
-
Save sephraim/02bf7f62cb0a4fefcaf68a237ea57243 to your computer and use it in GitHub Desktop.
[HTTParty examples]
This file contains hidden or 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
# GET | |
HTTParty.get('www.example.com') | |
# POST | |
HTTParty.post( | |
'www.example.com', | |
headers: { 'Content-Type' => 'application/json' }, | |
body: { | |
title: 'The Catcher in the Rye', | |
author: 'J. D. Salinger', | |
year: 1951 | |
}.to_json | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment