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

Support url query (params) for post method #150

Closed
isimluk opened this issue Sep 21, 2016 · 11 comments
Closed

Support url query (params) for post method #150

isimluk opened this issue Sep 21, 2016 · 11 comments

Comments

@isimluk
Copy link

isimluk commented Sep 21, 2016

Now, the params (url query) are supported only for get method. https://github.com/brynary/rack-test/blob/0cd85371dd5a347be78e48559b280ced72fab7f9/lib/rack/test.rb#L208

Having query params in POST url is perhaps not neat, but valid. Which leads me to think that rack-test should allow for testing it.

@stale
Copy link

stale bot commented Apr 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 20, 2018
@stale stale bot closed this as completed Apr 27, 2018
@davispuh
Copy link

davispuh commented Jan 1, 2020

How this still haven't been implemented... It's pretty common to have POST request with query params.

@junaruga
Copy link
Contributor

junaruga commented Jan 1, 2020

Sorry for closing ticket automatically. I opened the ticket to improve the situation.
#253

@junaruga junaruga reopened this Jan 1, 2020
@stale stale bot removed the wontfix label Jan 1, 2020
@stale
Copy link

stale bot commented Mar 1, 2020

A friendly reminder that this issue had no activity for 60 days.

@stale stale bot added the stale label Mar 1, 2020
@isimluk
Copy link
Author

isimluk commented Mar 2, 2020

A friendly reminder that this issue had no activity for 60 days.

Thank You.

@stale stale bot removed the stale label Mar 2, 2020
@junaruga
Copy link
Contributor

junaruga commented Mar 2, 2020

Note we are trying to move rack-test to rack org for sustainable maintenance.
#256

@jrcasso
Copy link

jrcasso commented Sep 22, 2021

Query params in HTTP POST happens in the wild. Being unable to test those scenarios with Rack is a pretty big letdown.

Edit:

In my situation, I was rescuing a percent-encoding error described here: whitequark/rack-utf8_sanitizer#40. One way to contrive this scenario in an rspec is like so:

env 'rack.input', StringIO.new('q=%%%')
post '/any_route'
expect(last_response.bad_request?).to eq true

jeremyevans added a commit to jeremyevans/rack-test that referenced this issue May 2, 2022
…uests

This allows you to set both body parameters (:params) and query
parameters (:query_params) for non-GET requests.

For consistency, GET requests also support :query_params.  If both
:params and :query_params are provided, :params will append to the
existing query before :query_params.

Implements rack#150.
@jeremyevans
Copy link
Contributor

I submitted pull request #287 to implement this support using the :query_params option

jeremyevans added a commit that referenced this issue May 2, 2022
…uests

This allows you to set both body parameters (:params) and query
parameters (:query_params) for non-GET requests.

For consistency, GET requests also support :query_params.  If both
:params and :query_params are provided, :params will append to the
existing query before :query_params.

Implements #150.
@jeremyevans
Copy link
Contributor

#287 was merged at 463ad89

@graywolf-at-work
Copy link

Would it be possible to get a release that would include this?

@jeremyevans
Copy link
Contributor

Yes. I'm planning a release fairly soon.

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

No branches or pull requests

6 participants