Access Google Maps API json in browser - google-maps

Silly question I am sure.
But how can I access this for simple testing but also whilst inside a phonegap which has no URL directly through the browser:
https://maps.googleapis.com/maps/api/geocode/json?address=122+flinders+st,+darlinghurst,+nsw,+australia&sensor=false&key=API_KEY
I have of course changed the API key which is a browser key. I have also changed my Referers: * So everything should be allowed.

Try this. It's a very simple phonegap maps api example.

One option is to use the Advanced REST Client Plugin which is free and you can install it on your chrome browser. This plugin opens directly in browser tab and you can set the request in a huge text box, set the type of request (GET, PUT, POST, DELETE etc) and also the parameters if required. You can see the results in below when you hit submit.
This Plugin is exclusively made for testing purposes relating to matter like sending a request to an API and then getting the results back from it in either JSON or XML format.
Click this link in order to install it in your Chrome Browser.
Hope that Helps!!

Related

How to find parameters (variables) in a web site by using google chrome for JMeter

I just started to use JMeter. I want to know how can I see the variables at google chrome. I tried so many ways and I watched lots of videos but there are no answers. Every video says that; you can find it in the network page from console. But on the website which im looking for variables, I just can see JavaScript code token. There is no token as variable. Is there a way to import it into JMeter or is there other way to find variables in google chrome. To put it in a nutshell, I'm working on a project. I want to load test for a website but I got problems with POST request. I cannot login the threads because of cannot find the variables. I need help !! :(
This is what I am trying to reach with screenShot...
This is my chrome's screenShot
I'm just tryna get the parameters like first pic.
There are 2 possibilities:
The "variable" comes in the response, take a closer look at:
response URL as it may be a part of the URL after redirection
response headers (can be observed in the "Network" tab of the developer tools)
response body, you can view page source
The variable gets "calculated" in the browser using JavaScript code. If this is the case you should find the relevant JavaScript function and implement it using JMeter's JSR223 Test Elements
You can also try recording your test scenario using BlazeMeter Proxy Recorder, it's capable of exporting recorded scripts in "SmartJMX" mode with automatic detection and correlation of the dynamic parameters. In case #2 it will not help, but if the variable comes with the response most probably it will be able to detect it. More information: How to Cut Your JMeter Scripting Time by 80%

REST Console Extension in Chrome

I am using REST Console.
I have to add multiple attachment with different parameter key. But I am not able to find option for this.
Is there is any other Extension available?
You have a couple other options:
Chrome:
Postman - REST Client
Advanced REST client
Firefox:
RESTClient
REST Easy (thanks to Nathan)
See if some of them meet your needs
I would definitely suggest DHC for chrome. For quite some time now I am using it on daily basis and I can say it works just fine and have features like saving entire requests under specific project -> method.
Here's demo: https://www.sprintapi.com/dhcs.html
Here's google chrome store link: https://chrome.google.com/webstore/detail/dhc-resthttp-api-client/aejoelaoggembcahagimdiliamlcdmfm?hl=en
If you just search for REST API console within google store you'll find many more.
All the best

Sending POST request via HTTP using Safari on Mac

I need to call a webservice with Safari on Mac. Since the methods are in POST I can't paste the url in the address bar of Safari (like with GET methods).
So, I'm looking for a plug-in or similar that allows me to send the request and then receive the response inside the browser. The response is JSON so with the JSON plug in I can see all the response with his formatting.
Solutions ? Thanks !
Safari is my browser of choice, so I can empathize with you for wanting a native plugin. Fortunately, while there aren't any extensions available, there are quite a few native OSX clients for HTTP/REST end-point testing. I have been using CocoaRestClient, which includes auto-formatting and syntax highlighting for JSON, as you requested. It's open source, lightweight, and is at least actively supported by its developers:
http://mmattozzi.github.io/cocoa-rest-client
Another great tool is Postman, an application inside Google Chrome.
I don't know why you care whether the client is in Safari or not. A restful POST should be able to be executed from any sort of client. You might want to look at RESTClient extension for Firefox http://restclient.net/
Also just Google 'REST client' you should see plenty of other tools available to generate POST's against your service. If you are really would about Safari-specific responses, most good REST tools, should allow you to set the User-Agent header so as to make the request look like it is coming from Safari.

Authentication with Box on iPad

I'm adding Box support to an iPad app. I tried the official SDK and I don't want to use it for the following reasons:
Login page is too wide for a modal controller with UIModalPresentationFormSheet style on iPad. The SDK hosts UIWebView which loads content of https://m.box.net/api/1.0/auth/, which perhaps returns HTML with min width set to 768px (although I didn't check the HTML, speculating here).
HTML in login page doesn't show Google Apps authentication option. The full desktop version of the page does.
Because the login page is hosted in UIWebView the user cannot be sure that he's supplying the credentials to Box, and not to an app author.
I don't need the whole SDK functionality, just authentication, folder/file listing and content download. Since my app also uses other cloud storage providers I'd prefer to provide uniform file browsing experience.
Here's what I'm going to do:
Add a custom URL scheme for my app, let's say "myapp".
In Box's Application settings for my app set Redirect URL to myapp://RedirFromBoxAuth.
When the user chooses to browse Box from inside my app, I'm going to:
Get a ticket by calling GET https://www.box.com/api/1.0/rest?action=get_ticket&api_key={API_KEY}
Extract the ticket, then call openUrl with https://www.box.com/api/1.0/auth/{TICKET} This will open Safari and let the user enter his credentials. This is the full, desktop version of the login page.
On successful login Box's server will tell Safari to redirect to myapp://RedirFromBoxAuth?ticket={TICKET}&auth_token={TOKEN}, which in turn will tell iOS to yield control to my app.
My app receives handleOpenURL notification and I can extract the authentication token and use REST API from now on.
Please comment, is it a good plan? I created a quick prototype and it seems to work, but maybe I'm missing something?
Box team, could you please tell us will an app using this authentication model be eligible for inclusion in OneCloud?
This seems like a good strategy and will probably make for a better UX/easier implementation than the normal redirect. Please let us know if you run into any weird edge cases by implementing it this way.

Google maps API v3 flash empty viewport

I'm using the google maps API v3 with flash and it works fine on one of my websites.
I transfered it to another website and changed the API key, but all I see is the default background color with no error message. Unfortunatly, I cannot access the flash source code.
Is there a way to debug the application or see some error messages without the source code?
Or maybe somebody has an idea of what is wrong?
Use Firebug Net monitor to see if all of the request are going through. That would be the first place that I would start. My guess is that there are HTTP Requests trying to get data from a domain that doesn't have a crossdomain policy allowing access from the new site you moved it to.
First of all maps V3 doesn't need a a key. I think you are combining parts of V2 (with key) and V3(which doesn't need key) so obviously there is something wrong in your code.