Questions tagged [google-http-client]

This refers to the Google HTTP Client Library for Java.

The Google HTTP Client library is a flexible, efficient, and powerful Java client library for accessing any resource on the web via HTTP. It features a pluggable HTTP transport abstraction that allows any low-level library to be used, such as java.net.HttpURLConnection, Apache HTTP Client, or URL Fetch on Google App Engine. It also features efficient JSON and XML data models for parsing and serialization of HTTP response and request content. The JSON and XML libraries are also fully pluggable, including support for Jackson and Android's GSON libraries for JSON.

Supports these Java environments:

  • Java 7 or higher
  • Android 4.4 (Kit Kat)
  • Google App Engine
67 questions
1
vote
1 answer

how to write HttpRequest with "get" Method

I'm using com.google.api.client.http I want to send some request with this package. HttpRequest request = new HttpRequest(new HttpTransport(),"GET"); But the HttpTransport in the package is abstract ,so it means I need to implement this class? Is…
karl li
  • 469
  • 1
  • 5
  • 17
0
votes
0 answers

Support for Authenticated Proxy in google-http-client java library

We are using NetHttpTransport provided by google-http-client java library, which allows us to specify a proxy. However, I could not figure out a way to specify the username and password. For Http proxies, we could provide it using…
Ahmad Naseem
  • 104
  • 10
0
votes
2 answers

Using google-http-client and google-http-client-apache-v2 behind a proxy produces NonRepeatableRequestException

I'm using google-http-client and google-http-client-apache-v2 libraries to make a POST request behind a proxy. // 1.- Setting ssl and proxy HttpClientBuilder builder = HttpClientBuilder.create(); SSLContext sslContext =…
IJR
  • 552
  • 1
  • 6
  • 10
0
votes
1 answer

Need help on POST request using com.google.api.client.http.HttpRequest

I am trying to send the post request using com.google.api.client.http.HttpRequest with data in request Body but getting error com.google.api.client.http.HttpResponseException: 400 Bad Request I need to send the request…
0
votes
2 answers

Increase time of invoking loadDataFromNetwork() of RoboSpice service

I use RoboSpice with OkHttpClient module (OkHttpSpiceService) for quite long time requests. For that purposes I need to increase timeouts of http client so I made and set them on 120 seconds. @Override protected OkHttpClient…
Geo ZiDani
  • 111
  • 1
  • 1
  • 8
0
votes
1 answer

DirectionResult has null routes and waypoints - Google Directions API

My goal for this program was to poll the Google Directions API and plot the course by Polyline on a MapView in an Android app. However, when I get the DirectionsResult back from the API call, trying to access directionsResult.routes[0] or…
0
votes
1 answer

NT Authentication with GoogleHttpClient

How are you supposed to do NT Authentication using the Google Http Client? I can find plenty of information for the Apache HttpClient and NTCredentials and I have that working but nothing on the Google client which I am trying to standardize new…
0
votes
1 answer

How to set the application name using the HTTP Client Library for Java?

I am using the HTTP Client Library for Java to access the Google Custom Search API and perform a search. String key = "..."; String cx = "..."; String query = "..."; // Set up the HTTP transport and JSON factory HttpTransport httpTransport =…
Peter
  • 213
  • 2
  • 5
  • 14
0
votes
1 answer

BigQuery - How to set read timeout in the Java client library

I am using Spark to load some data into BigQuery. The idea is to read data from S3 and use Spark and BigQuery client API to load data. Below is the code that does the insert into BigQuery. val bq =…
Jegan
  • 1,721
  • 1
  • 20
  • 25
0
votes
1 answer

Robospice exception never caught in RequestListener

I have an android app which uses Robospice with Google HTTP client to send RESTful request to a server. All works fine if result is successfully returned but if an exception is returned from my service, the Robospice listener doesn't catch the…
Akshat
  • 278
  • 5
  • 19
0
votes
1 answer

Google Http Client Library java: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('G'

I am making a HTTP get request, which gives me a JSON response: { time : 1345111524000 sub : Test vote msg : remain : 420 cur_time : 1345113672856 ver : 1.2.2 p_type : 0 ..... I am using Google HTTP Client Library for Java My…
NarendraSoni
  • 2,210
  • 18
  • 26
0
votes
1 answer

No content in HttpResponse even though content is sent from server

Code: HttpContent content = createLoginContent(username, password); GenericUrl url = new GenericUrl(serverUrl); HttpRequest postRequest = httpRequestFactory.buildPostRequest(url,…
Darajan
  • 868
  • 1
  • 9
  • 23
0
votes
1 answer

How to parse data in Json farmet using google http client (Android app)?

I am getting data from server by building a get request (HttpRequest). The data is not in Json format (when I open the link in a web browser, it says "This XML file does not appear to have any style information associated with it. The document tree…
Derekyy
  • 1,018
  • 4
  • 18
  • 31
0
votes
1 answer

Getting 500 error (missing ;) from blobstore upload

I would like to skip the part where an upload URL is sent to the client, and upload directly to the blobstore from the backend. I use this to send the multipart request, although I get:

HTTP ERROR 500

Problem…

azyoot
  • 1,162
  • 8
  • 18
0
votes
1 answer

Cookie policy difference between ApacheHttpTransport and NetHttpTransport

I've been having some problems with some POSTS / GETS when I switched from ApacheHttpTransport to NetHttpTransport. After some digging, I think that NetHttpTransport does not set cookies. Is this a correct assessment of NetHttpTransport? (And if so,…
dsmith
  • 154
  • 5