-
Notifications
You must be signed in to change notification settings - Fork 250
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
Comments
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. |
How this still haven't been implemented... It's pretty common to have POST request with query params. |
Sorry for closing ticket automatically. I opened the ticket to improve the situation. |
A friendly reminder that this issue had no activity for 60 days. |
Thank You. |
Note we are trying to move rack-test to rack org for sustainable maintenance. |
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 |
…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.
I submitted pull request #287 to implement this support using the |
…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.
Would it be possible to get a release that would include this? |
Yes. I'm planning a release fairly soon. |
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.
The text was updated successfully, but these errors were encountered: