Skip to content

Instantly share code, notes, and snippets.

Last active July 11, 2018 17:34
What would you like to do?
Combining Protocol Conventions - Request
require 'uri'
require 'net/http'
class MemberService
def get_members(
query_params = filters.to_query
uri = URI("{query_params}")
request =, {'Content-Type' => 'application/json'})
request.body = json_options: {
only: [:name, :date_of_birth],
include: {
dependents: {
only: [:name, :date_of_birth]
response = http.request(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment