If I use:

```
xhr.setRequestHeader("Content-Type", "application/json");

```

Am I forced to receive a `json` response also ? Or I can receive a `html` response instead?

If I can receive any format I want, what is the best way to dynamically manage this 2 aspects:

1. the way that I will parse the response (to parse a json or not)
2. what `Accept` header to use

For example my function should set:

```
xhr.setRequestHeader('Accept', "application/json");

```

in case it waits for a json response, but also do a json parse on the response also, but in case it's a html reponse there is no need for something like this.

So is there any way to manage dynamically the response handling?