Skip to content

Commit ce5fa00

Browse files
authored
Update README.md
1 parent ea65de4 commit ce5fa00

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,25 @@ WebApiClient.Disassociate(request)
164164
});
165165
```
166166

167+
### Not yet implemented requests
168+
If you need to use requests, that are not yet implemented, you can use the ```WebApiClient.SendRequest``` function.
169+
In combination with ```WebApiClient.GetApiUrl``` and ```WebApiClient.GetSetName``` you can easily build up your request url, set your HTTP method and attach additional payload or headers.
170+
171+
An example of a custom implementation of the WinOpportunity request:
172+
```Javascript
173+
var url = WebApiClient.GetApiUrl() + "WinOpportunity";
174+
var opportunityId = "00000000-0000-0000-0000-000000000001";
175+
var payload = {
176+
"Status": 3,
177+
"OpportunityClose": {
178+
"subject": "Won Opportunity",
179+
"opportunityid@odata.bind": "/" + WebApiClient.GetSetName("opportunity") + "(" + opportunityId + ")"
180+
}
181+
};
182+
183+
WebApiClient.SendRequest("POST", url, payload);
184+
```
185+
167186
### Promises
168187
This client uses bluebird for handling promises in a cross-browser compliant way.
169188
For this reason bluebird is exported as global implementation of promises (and also overrides browser native Promises).

0 commit comments

Comments
 (0)