A sample HTTP proxy Lightning Component and JavaScript API.
##Description Provides a proxy for accessing HTTP (REST) APIs via a Lightning Component. A Visualforce page and component are leveraged to provide access, currently restricted in Lightning Components (as of Winter '16) due to the Content Security Policy (CSP).
A sample HTTP browser is provided as an example. The core component (c:http) can be used in other applications to provide event- and attribute-based access. Additionally, an API is provided for programmatic and/or command-line access.
##Usage
###UI
- Import/copy the Lightning Components into your org.
- Import/copy the Visualforce Pages and Components into your org.
- Go to https://yourdomain-dev-ed.lightning.force.com/c/httpTest.app
- Enable the "Auto" checkbox.
- Press the "Exec" button.
- Select the desired URLs to browse the API.
###API
- Access the UI as above.
- Open the developer tools and navigate to the Console tab.
- Type $ltngx.http("/services/data", function(result, status, headers) { console.warn(result, status, headers); });
- Expand the results and headers to view the values.
- Note that the API and UI are in-sync and may be used interchangeably.