-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update base_request to properly handle posts #81
Update base_request to properly handle posts #81
Conversation
exception_class = Parliament::NoContentResponseError if net_response['Content-Length'] == '0' | ||
when Net::HTTPClientError # 4xx Status | ||
exception_class = Parliament::ClientError | ||
when Net::HTTPServerError # 5xx Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent when as deep as case.
exception_class = Parliament::ServerError | ||
when Net::HTTPOK # 2xx Status | ||
exception_class = Parliament::NoContentResponseError if net_response['Content-Length'] == '0' | ||
when Net::HTTPClientError # 4xx Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent when as deep as case.
exception_class = Parliament::ClientError | ||
when Net::HTTPServerError # 5xx Status | ||
exception_class = Parliament::ServerError | ||
when Net::HTTPOK # 2xx Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent when as deep as case.
api_request.body = body unless body.nil? | ||
request = Net::HTTP::Post.new( | ||
endpoint_uri.request_uri, | ||
'Content-Type' => 'application/json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one level of indentation for parameters following the first line of a multi-line method call.
add_headers(api_request) | ||
api_request.body = body unless body.nil? | ||
request = Net::HTTP::Post.new( | ||
endpoint_uri.request_uri, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one level of indentation for parameters following the first line of a multi-line method call.
Indent the first parameter one step more than the start of the previous line.
No description provided.