Skip to content

Commit 810416d

Browse files
committed
add info about callHttp()
1 parent fe50cfe commit 810416d

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

articles/azure-functions/durable/durable-functions-node-model-upgrade.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,4 +779,69 @@ waitForCompletionOrCreateCheckStatusResponse(
779779
780780
## Update calls to callHttp API
781781
782-
If your orchestrator used the `
782+
In v3.x of `durable-functions`, the `callHttp()` API for `DurableOrchestrationContext` was updated. The following changes were made:
783+
784+
- Accept one options object for all arguments, instead of multiple optional arguments, to be more similar to frameworks such as [Express](https://expressjs.com/).
785+
- Rename `uri` argument to `url`
786+
- Rename `content` argument to `body`
787+
- Deprecate `asynchronousPatternEnabled` flag in favor of `enablePolling`.
788+
789+
If your orchestrations used the `callHttp` API, make sure to update these API calls to conform to the above changes. Find an example below:
790+
791+
:::zone pivot="programming-language-javascript"
792+
793+
# [v4 model](#tab/v4)
794+
795+
```javascript
796+
const restartResponse = yield context.df.callHttp({
797+
method: "POST",
798+
url: `https://example.com`,
799+
body: "body",
800+
enablePolling: false
801+
});
802+
```
803+
804+
# [v3 model](#tab/v3)
805+
806+
```javascript
807+
const response = yield context.df.callHttp(
808+
"POST",
809+
`https://example.com`,
810+
"body", // request content
811+
undefined, // no request headers
812+
undefined, // no token source
813+
false // disable polling
814+
);
815+
```
816+
817+
---
818+
:::zone-end
819+
820+
:::zone pivot="programming-language-typescript"
821+
822+
# [v4 model](#tab/v4)
823+
824+
```typescript
825+
const restartResponse = yield context.df.callHttp({
826+
method: "POST",
827+
url: `https://example.com`,
828+
body: "body",
829+
enablePolling: false
830+
});
831+
```
832+
833+
# [v3 model](#tab/v3)
834+
835+
```javascript
836+
const response = yield context.df.callHttp(
837+
"POST",
838+
`https://example.com`,
839+
"body", // request content
840+
undefined, // no request headers
841+
undefined, // no token source
842+
false // disable polling
843+
);
844+
```
845+
846+
---
847+
:::zone-end

0 commit comments

Comments
 (0)