# Status 406 - "not acceptable"

**URL:** <https://ask.openrouteservice.org/t/status-406-not-acceptable/3408>\
**Category:** openrouteservice\
**Created:** [December 16, 2021, 11:06am UTC](https://ask.openrouteservice.org/t/status-406-not-acceptable/3408 "2021-12-16T11:06:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jannefleischer](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jannefleischer/32/1400_2.png) [@jannefleischer](https://ask.openrouteservice.org/u/jannefleischer)\
**Post date:** [December 16, 2021, 11:06am UTC](https://ask.openrouteservice.org/t/status-406-not-acceptable/3408/1 "2021-12-16T11:06:52Z")

</div>

Hi,

I am developing an WebApp that should downloads directions from openrouteservice. While doing this, I am running into a CORS-Issue that I can’t fix myself.

I do have a custom deployment of ors on my own server (6.1.0), but either my own deployment, nor [api.openrouteservice.org](http://api.openrouteservice.org) wouldn’t give me any other response then this:

```json
{
body: (...)
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 406
statusText: "Not Acceptable"
type: "cors"
url: "https://api.openrouteservice.org/v2/directions/driving-car?api_key=xxx&start=7.429504967636316,51.51331787611618&end=7.427511500153572,51.517601389205424"
}

```

What can I do to have a more willingly serving server?

If I call the url manually (and not from my locally (with parcel) hosted App) I get a response I can work with.

Please be aware, when you take your time to answer: I am not a trained developer but an urban planner doing some programming… (and am not really sure if I understand CORS at all…).

Kind regards + thank you! Janne

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [December 16, 2021, 11:10am UTC](https://ask.openrouteservice.org/t/status-406-not-acceptable/3408/2 "2021-12-16T11:10:05Z")

</div>

Hey,

without further review, just b/c “CORS” was mentioned - have a look at the last two comments in [this](https://ask.openrouteservice.org/t/linking-backend-with-frontend/3383) thread, that might help.

Best regards

---

<div class="post-metadata">

**Author:** ![jannefleischer](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jannefleischer/32/1400_2.png) [@jannefleischer](https://ask.openrouteservice.org/u/jannefleischer)\
**Post date:** [December 16, 2021, 11:29am UTC](https://ask.openrouteservice.org/t/status-406-not-acceptable/3408/3 "2021-12-16T11:29:59Z")

</div>

I think my web.xml ist correct (it is the default, deployed by docker-compose PLUS added “Authorization”)

```xml
    <filter>
                <filter-name>CorsFilter</filter-name>
                <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
                <init-param>
                        <param-name>cors.allowed.origins</param-name>
                        <param-value>*</param-value>
                </init-param>
                <init-param>
                        <param-name>cors.allowed.methods</param-name>
                        <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
                </init-param>
                <init-param>
                        <param-name>cors.allowed.headers</param-name>
                        <param-value>Authorization,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
                </init-param>
                <init-param>
                        <param-name>cors.exposed.headers</param-name>
                        <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
                </init-param>
                <init-param>
                        <param-name>cors.support.credentials</param-name>
                        <param-value>false</param-value>
                </init-param>
                <init-param>
                        <param-name>cors.preflight.maxage</param-name>
                        <param-value>10</param-value>
                </init-param>
        </filter>

        <filter-mapping>
                <filter-name>CorsFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>

```

Any other ideas? Is it possible I call it wrong from my webapp?

And just to make it more clear: openrouteservice ist deployed on a server. The development happens on localhost.

---

<div class="post-metadata">

**Author:** ![jannefleischer](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jannefleischer/32/1400_2.png) [@jannefleischer](https://ask.openrouteservice.org/u/jannefleischer)\
**Post date:** [December 16, 2021, 11:55am UTC](https://ask.openrouteservice.org/t/status-406-not-acceptable/3408/4 "2021-12-16T11:55:24Z")

</div>

Ah, I am sorry. I sent the wrong header ’ accept: “application/json” ’ - Now it works.
