I was making some request calls to the 'search' endpoint to get some information about paintings, and noticed some very odd behavior regarding the hasImages field. When encoding data via the requests library, the upper case 'T' in 'True' causes issues with the case sensitive nature of the hasImages field. You can see here that there is quite a large difference between manually encoding data and letting the library encode that data for you
Manual Encoding (12111 results):
object_ids_large = session.get(BASE_URL+"/search?hasImages=true&medium=Paintings&q=%22%22").json()
Requests Library Encoding (228 results):
object_ids_small = session.get(BASE_URL+"/search", params={ "hasImages" : True, "medium" : "Paintings","q":""}).json()
I had tried using a string in my params (passing "true"), but that returned 0 results, so however this boolean is interpreted on the backend query behaves strange across languages.
I was making some request calls to the 'search' endpoint to get some information about paintings, and noticed some very odd behavior regarding the
hasImagesfield. When encoding data via the requests library, the upper case 'T' in 'True' causes issues with the case sensitive nature of thehasImagesfield. You can see here that there is quite a large difference between manually encoding data and letting the library encode that data for youManual Encoding (12111 results):
Requests Library Encoding (228 results):
I had tried using a string in my params (passing
"true"), but that returned 0 results, so however this boolean is interpreted on the backend query behaves strange across languages.