You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 27, 2024. It is now read-only.
for working with Salesforce REST API and JavaScript Fetch API
6
6
directly from your component's JavaScript without you needing to
7
7
write Apex or configure Named Credentials. Just install and use.
8
8
@@ -11,15 +11,15 @@ write Apex or configure Named Credentials. Just install and use.
11
11
12
12
1. Deploy this project to your org (you only need what's in `force-app` folder).
13
13
14
-
2. Explore the `LC_Demo` component in the `force-demo` folder on usage.
14
+
2. Explore the `LC_RequestDemo` and `LC_FetchDemo` components in the `force-demo` folder on usage.
15
15
16
16
3. Try out a demo
17
17
18
18
a. Assign yourself the **LC Demo** permission set.
19
19
20
20
b. Navigate to the **LC Demo** tab.
21
21
22
-
c. Play with the sample components to send different REST API requests.
22
+
c. Play with the sample components to send different [REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) requests.
23
23
24
24
d. Marvel that you didn't have to write any Apex code or configure a Named Credential :)
25
25
@@ -31,19 +31,21 @@ Add the `<c:lc_api>` to your component and give it an `aura:id` for reference.
31
31
```xml
32
32
<!-- YourComponent.cmp -->
33
33
<aura:component>
34
-
<c:lc_apiaura:id="restClient"/>
34
+
<c:lc_apiaura:id="lc_api"/>
35
35
...
36
36
</aura:component>
37
37
```
38
38
39
-
Find the `<c:lc_api>` by its `aura:id` then call the `restRequest(..)` method passing in the `url`, `method`, `body`, and any `headers`.
39
+
Find the `<c:lc_api>` by its `aura:id` then call one of the request methods:
40
+
* The `restRequest(..)` method passing in a JSON object with the `url`, `method`, `body`, and any `headers` properties, or
41
+
* The `fetchRequest(..)` method passing in a JSON object with the `url` and `options` properties
0 commit comments