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

Add post functionality to parliament-ruby #79

Merged

Conversation

mattrayner
Copy link
Contributor

Implemented #post on Parliament::Request::BaseRequest + associated tests

Implemented #post on Parliament::Request::BaseRequest + associated tests
# @param [String] body (optional) body of the post request.
#
# @return [Parliament::Response::BaseResponse] a Parliament::Response::BaseResponse object containing all of the data returned from the URL.
def post(params: nil, body: nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assignment Branch Condition size for post is too high. [21.91/15]
Method has too many lines. [13/10]

# @param [Hash] params (optional) additional URI encoded form values to be added to the URI.
# @param [String] body (optional) body of the post request.
#
# @return [Parliament::Response::BaseResponse] a Parliament::Response::BaseResponse object containing all of the data returned from the URL.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [146/120]

#
# # url: http://example.com/people/current?limit=10&page=4&lang=en-gb
#
# response = request.post({ limit: 10, page: 4, lang: 'en-gb' }, body: {}.to_json) #=> #<Parliament::Response::BaseResponse ...>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [136/120]

# response = request.post(body: {}.to_json) #=> #<Parliament::Response::BaseResponse ...>
#
# @example HTTP POST request with URI encoded form values
# request = Parliament::Request::BaseRequest.new(base_url: 'http://example.com/people/current', headers: {'Content': 'application/json', 'Accept': 'application/json'})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [175/120]

# Makes an HTTP POST request and process results into a response.
#
# @example HTTP POST request
# request = Parliament::Request::BaseRequest.new(base_url: 'http://example.com/people/123', headers: {'Content': 'application/json', 'Accept': 'application/json'})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [171/120]

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 797662f on mattrayner:mattrayner/add-post-ability into 430db93 on ukparliament:master.

@bryonywatson1 bryonywatson1 merged commit bb513cd into ukparliament:master Oct 19, 2017
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