aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.16k stars 836 forks source link

Cannot perform search using CloudSearchDomainClient #923

Closed EthanStandel closed 5 years ago

EthanStandel commented 5 years ago

Expected Behavior

Successfully call cloudSearchDomainClient.search and get a response back.

Current Behavior

When calling search through the SDK, the CloudSearch response is a 403 with the message: When Content-Type:application/x-www-form-urlencoded, URL cannot include query-string parameters (after '?') followed by the URL that got called in the request (with the query and filter as request parameters). However, there appears to be no way, via the SDK (besides manually implementing an HttpClient to circumvent the way the request is being made) to control how the search parameters are sent and/or what the Content-Type is.

Possible Solution

Allow the user to specify the Content-Type for the SearchRequest or tell the SearchRequest to put the search details as a post-body.

Steps to Reproduce (for bugs)

Make a search off a CloudSearch domain using default configurations with security settings for the domain turned off, for simplicities sake. I've already reverted the code, but I was using very basic and default settings. Notably, I was able to make the same call with the 1.11.x SDK.

Context

This has blocked my team from being able to upgrade our SDK from 1.11.x to 2.x.

Your Environment

shorea commented 5 years ago

Identified the problem, working on a fix.

shorea commented 5 years ago

This has been fixed on master, it will be included in our next release. Thanks for reporting!

EthanStandel commented 5 years ago

Thank you for your quick response!