Chances are I'm doing something wrong, but using a Curl/Rest client I'm able to send a http request to a server using an Oauth2 generated token, here's the details:

```
url: https://blah.blah
Authorization: OAuth <oauth token>
Accept: application/blah (I'm hiding some of the details...)

```

This works fine using Curl/Rest and I'm getting back a JSON object as expected. However, when doing this in Java, I'm getting a 401 every time. I'm guessing I'm messing up appending the headers somehow, but I can't see how.

```
url = new URL(baseUrl+ reqUrl);
    System.out.println("Querying API with the following url:" + url.toString());

    httpReq = (HttpURLConnection) url.openConnection();
    httpReq.addRequestProperty("Authorization: OAuth ", token.trim());
    httpReq.addRequestProperty("Accept", "application/blah...");
    httpReq.connect();

```

I'm guessing I'm getting the header set up wrong, but I can't see how. Is there a better way to implement the headers to the http request?

Any input or advice would be greatly appreciated.
Thanks