Skip to content Skip to sidebar Skip to footer

Google Oauth 2.0 Authentication For Limited Input Device Not Working Except On Curl

I am trying to use a custom java application of mine to upload videos to my youtube account via an access limited device like a Raspberry pi running as a server. For this I am usin

Solution 1:

The parameters need to be added in the http post request body not in the url, Google documentation is confusing on this part.

    public synchronized HttpResponse executePOST(HttpEntity httpEntity, String path) throws IOException {
    if (!parameters.isEmpty()) {
        httpPost.setEntity(new UrlEncodedFormEntity(parameters));
    }

    httpPost = new HttpPost(path);

    logger.info(target.toHostString());
    logger.info(httpPost.getURI().toString());
    logger.info(httpPost.getRequestLine().toString());
    for (Header header : headers) {
        logger.info(header.getName() + ": " + header.getValue());
        httpPost.addHeader(header);
    }
    httpResponse = httpClient.execute(target, httpPost);
    return httpResponse;
}

Post a Comment for "Google Oauth 2.0 Authentication For Limited Input Device Not Working Except On Curl"