Skip to content
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

Merged

Conversation

mattrayner
Copy link
Contributor

No description provided.

exception_class = Parliament::NoContentResponseError if net_response['Content-Length'] == '0'
when Net::HTTPClientError # 4xx Status
exception_class = Parliament::ClientError
when Net::HTTPServerError # 5xx Status

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

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

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'

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,

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a2b4b2f on mattrayner:mattrayner/add-post-ability into c072cfd on ukparliament:master.

@mattrayner mattrayner merged commit 3f13f7e into ukparliament:master Nov 7, 2017
@mattrayner mattrayner deleted the mattrayner/add-post-ability branch November 7, 2017 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants