Sending POST request via HTTP using Safari on Mac - json

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.

Related

Access Google Maps API json in browser

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!!

Using fiddler to capture html when no proxy support in browser

I'm using the webview tag in chromium and I want to capture the html requests. Unfortunately webview does not support proxies. Is there any way I can just do a normal http request to fiddler at localhost:8888 and somehow put the real destination in the URL? Maybe something like http://localhost:8888?url=google.com?
I'm not clear on which Chromium you're using, but generally I'd expect that it should adopt the OS proxy settings, and if it doesn't, that's a bug that should get filed.
Yes, you can send Web Requests directly to Fiddler using the technique you describe, but the cookies and security permissions aren't likely to work correctly.

How to automate a Chrome extension with UFT

The new version of UFT 12.01 is supporting up to Chrome 36 when it comes to web content.
What about Chrome´s extensions though?
I read somewhere that they cannot be automated.
From the other hand side, when I use developer tools (12) I can identify buttons, textboxes etc.
Is it possible to test a Chrome extension by using UFT?
PS: I specifically try to automate one extension called POSTMAN - Rest Client (https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en)
UFT's Chrome support doesn't work with other extensions since Chrome disallows extensions being injected into other extensions.
As a workaround you may be able to use UFT's Insight option to automate any technology that UFT doesn't support directly.
Specifically for the Postman extension, this is a simple REST Client. I Assume you want to use it in order to test your REST services rather than actually testing the Postman extension. If this is the case wouldn't a more natural way to approach this issue be to use a UFT API test?
API tests support calling and validating REST services with all the functionality previously available in HP's Service Test.

How to view request response for non Ajax Calls

I am working on a Web based application where the user interface is made using Jquery and the backend was developed using Java / Java EE.
On the user interface once I click on the submit button, the request goes and
the response comes from the back end. (This is not an AJAX call)
Is it possible to see what data went as request and how the response came back from the back end? Are there any such tools to view the request / response if it's not an AJax Call?
By the way I am using Chrome and Apple browsers.
Use the Network tab of Web Inspector (Chrome/WebKit) or Web Console (Firefox) or the Net tab (Firefox with Firebug)
Another option than using a browsers native network inspector (which btw DOES work for non-Ajax requests), is to use an intercepting proxy.
Burp Proxy is particular nice. It allows you to see, hold and if needed modify both the request and the response between the browser and the server. You do need to setup your browser to use a proxy. It has a somewhat steeper learning curve than the browser's native network inspectors, but once you get the hang of it it's quite an invaluable tool.

Chrome Extensions accessing header information

I am on a mission to expand my knowledge and create an extension for chrome similar to how firephp works. I want to integrate with my existing logging and debugging api within my framework and I want to be able to send these messages to the console. Nothing really robust to start with just a way to send debug messages to the chrome console from php.
The plan is to send the messages via the headers and have the extension read those headers and interpret them. I've been trying to find information on accessing the response headers and can't find any examples. Some of the research has led me to possibly having to develop an NPAPI plugin to be able to accomplish this.
Before traveling down a dead end path I wanted to get the communities opinion here on which path I should be taking to find a solution.
Chrome cannot currently do this, but Google is working on it. A preliminary and incomplete implementation is in the development version of Chrome, or in Chrome Canary.
http://code.google.com/chrome/extensions/experimental.webRequest.html
onHeadersReceived
http://dev.chromium.org/developers/design-documents/extensions/notifications-of-web-request-and-navigation
You can track progress here.
http://crbug.com/50943
The web request api is now in stable and can be used to access header events.
https://developer.chrome.com/extensions/webRequest.html
Here is an extension that does what you are trying to do. It uses cookies to communicate, from what I can tell.