# Getting Bad Request Error for scroll call via python requests

**URL:** <https://forum.opensearch.org/t/getting-bad-request-error-for-scroll-call-via-python-requests/15863>\
**Category:** OpenSearch\
**Tags:** troubleshoot\
**Created:** [September 12, 2023, 9:43am UTC](https://forum.opensearch.org/t/getting-bad-request-error-for-scroll-call-via-python-requests/15863 "2023-09-12T09:43:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemonjuice](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@lemonjuice](https://forum.opensearch.org/u/lemonjuice)\
**Post date:** [September 12, 2023, 9:43am UTC](https://forum.opensearch.org/t/getting-bad-request-error-for-scroll-call-via-python-requests/15863/1 "2023-09-12T09:43:35Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
OpenSearch Version 2.14.1

**Describe the issue** :  
I’m using a python app to scroll through an index. Therefore i use the python requests package to perform the neccessary curl requests.  
While the first search and also other requests to the api are successful the scroll request returns with a http 400 Bad Request.

Also putting the scroll id as a parameter in the data field did return the same error.  
Any ideas where this can occur from?

I’m currently adding a feature to also scroll on index patterns but since adding the possibility of a wildcard for the indice this erro occurs. It does not appear if i use the same commands in the devtools i dont get this error

**Configuration** :  
Curl Requests:

```auto
requests.get("https://<os-url>/<index>/_search?scroll=10m", headers={"Authorization": "Basic <token>", "Content-Type": "application/json", data={"size":10000, "query": <query>}, verify=False}

requests.get("https://<os-url>/_search/scroll/<scroll_id>", , headers={"Authorization": "Basic <token>", "Content-Type": "application/json", data={"scroll":"10m"}, verify=False)

```

---

<div class="post-metadata">

**Author:** ![Eugene7](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Eugene7](https://forum.opensearch.org/u/Eugene7)\
**Post date:** [September 12, 2023, 3:23pm UTC](https://forum.opensearch.org/t/getting-bad-request-error-for-scroll-call-via-python-requests/15863/2 "2023-09-12T15:23:48Z")

</div>

Hi @lemonjuice  
Could you share the OpenSearch log for this error?

---

<div class="post-metadata">

**Author:** ![lemonjuice](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@lemonjuice](https://forum.opensearch.org/u/lemonjuice)\
**Post date:** [September 13, 2023, 8:05am UTC](https://forum.opensearch.org/t/getting-bad-request-error-for-scroll-call-via-python-requests/15863/3 "2023-09-13T08:05:16Z")

</div>

I found the error myself, it was a mistake in a request configuration.
