Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5930667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:35:08+00:00 2026-05-22T14:35:08+00:00

I am trying to access google places api from appengine using code like this:

  • 0

I am trying to access google places api from appengine using code like this:

String PLACES_DETAILS_URL = “https://maps.googleapis.com/maps/api/place/details/json”;

       // setup up the HTTP transport
    HttpTransport transport = new UrlFetchTransport();
    // add default headers
    GoogleHeaders defaultHeaders = new GoogleHeaders();
    transport.defaultHeaders = defaultHeaders;
   transport.defaultHeaders.put("Content-Type", "application/json");
    JsonHttpParser parser = new JsonHttpParser();
    parser.jsonFactory = new JacksonFactory();
    transport.addParser(parser);

    // build the HTTP GET request and URL
    HttpRequest request = transport.buildGetRequest();
    request.setUrl(PLACES_DETAILS_URL);
    GenericData data = new GenericData();
    data.put("reference", restaurantGoogleId);
    data.put("sensor", "false");
    data.put("key", ApplicationConstants.GoogleApiKey);
    JsonHttpContent content = new JsonHttpContent();
    content.jsonFactory=new JacksonFactory();
    content.data = data;
    request.content = content;

    try {
        HttpResponse response =  request.execute();
        String r = response.parseAsString();

        r=r;
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

I don’t know even if this is the recommended way. If so, why this doesn’t work?If I put a request in the browser directly it works, but with this code it always returns me “Request Denied”.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:35:09+00:00Added an answer on May 22, 2026 at 2:35 pm

    At the end it was easy, I mixed get and post verbs:

    HttpTransport transport = new UrlFetchTransport();
            // add default headers
            GoogleHeaders defaultHeaders = new GoogleHeaders();
            transport.defaultHeaders = defaultHeaders;
           transport.defaultHeaders.put("Content-Type", "application/json");
           JsonCParser parser = new JsonCParser();
            parser.jsonFactory = new JacksonFactory();
            transport.addParser(parser);
    
            // build the HTTP GET request and URL
            HttpRequest request = transport.buildGetRequest();
            request.setUrl("https://maps.googleapis.com/maps/api/place/details/json?reference=CmRYAAAAciqGsTRX1mXRvuXSH2ErwW-jCINE1aLiwP64MCWDN5vkXvXoQGPKldMfmdGyqWSpm7BEYCgDm-iv7Kc2PF7QA7brMAwBbAcqMr5i1f4PwTpaovIZjysCEZTry8Ez30wpEhCNCXpynextCld2EBsDkRKsGhSLayuRyFsex6JA6NPh9dyupoTH3g&sensor=true&key=<APIKEY>");
    
    
            try {
                HttpResponse response =  request.execute();
                String r = response.parseAsString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access my Google spreadsheets using the GData API. I have followed
I'm trying to access Gmail by using three-legged Oauth PHP code provided by Google
I am trying to request JSON from Google Places API, but I am still
I am trying to get Oauth working with the Google API using Python. I
I am trying to use http://code.google.com/p/amazon-s3-php-class/ to force-dowload files from AWS S3. I have
I am trying to access a method in my code behind called Button1_Click using
I am trying to auto email a report from access using VBA in a
I'm trying to test a google maps app with Rails3. I'm using cucumber with
I am trying to access the google calendar using gdata. but the application closes
I am trying to access some basic info from an XML based API. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.