# Why does this query not work via URL but does by CURL

**URL:** <https://discuss.elastic.co/t/why-does-this-query-not-work-via-url-but-does-by-curl/25735>\
**Category:** Elasticsearch\
**Created:** [July 16, 2015, 5:22pm UTC](https://discuss.elastic.co/t/why-does-this-query-not-work-via-url-but-does-by-curl/25735 "2015-07-16T17:22:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorsuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/taylorsuk/32/3697_2.png) [@taylorsuk](https://discuss.elastic.co/u/taylorsuk)\
**Post date:** [July 16, 2015, 5:22pm UTC](https://discuss.elastic.co/t/why-does-this-query-not-work-via-url-but-does-by-curl/25735/1 "2015-07-16T17:22:06Z")

</div>

I am using angular to pass my query to a URL and it works fine with one query however it doesn't work with another.

Please can someone tell me the difference between these two and let me know why the second does not work.

**Works**

```
 searchQuery = {
    "query": {
        "match": {
            "_all": {
                "query": term,
                "operator": "and"
            }
        }
    },
    "aggs": {},
    "size": 20
};

```

**Doesn't Work via URL but does via CURL**

```
searchQuery = {
    "query": {
        "bool": {
            "should": [{
                "match": {
                    "exerciseName": "Squat"
                }
            }]
        }
    }
}

```

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:00am UTC](https://discuss.elastic.co/t/why-does-this-query-not-work-via-url-but-does-by-curl/25735/2 "2017-07-06T00:00:59Z")

</div>

Closed on July 6, 2017, 12:00am UTC


