isamplesorg / isamples_inabox

Provides functionality intermediate to a collection and central
0 stars 1 forks source link

For Post methods, support querying by including the parameters in the request body if it is encoded as JSON #344

Closed dannymandel closed 5 months ago

dannymandel commented 5 months ago

As @rdhyee noted, we weren't properly read solr requests out of the body if the method was post (it was looking in the query string). For post methods, it makes sense to read this out of the request body and expect it to be JSON. This is what we are using to query solr, and this is what the solr documentation recommends.

dannymandel commented 5 months ago

With this change, @rdhyee's example code now outputs the same with GET and POST.

dannymandel commented 5 months ago

I had to make a couple changes to the sample code to make it work:

image