0

How to make sequential (synchronous) http POST calls (wait the response from each call)

generateDoc(project, Item, language, isDOCXFormat) : Observable<any> {
        return this.http.post(this.sessionStorageService.retrieve('backendApi').baseUri + '/export/document/' + project.projectId + '/' + Item.id,
                     {language:language, isDOCXFormat:isPDFFormat}, option);
    }

Thank you.

1

1 Answer 1

2

If you want synchronous calls, you can use concatMap:

http.post(url1, data1).concatMap(t=> http.post(url2, data2);
Sign up to request clarification or add additional context in comments.

1 Comment

seems good, can you give me an example with generateDoc(params) method. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.