Synchronous or Sequential fetch in Service Worker [duplicate]
问题 This question already has answers here : Resolve promises one after another (i.e. in sequence)? (24 answers) Closed 4 years ago . I need to send a series of PUT & POST requests from a Service Worker. The order in which they're sent matters. Requirements: Given a request method, url, and JSON body, send the request If it succeeds ( response.status < 300 ): Pass body to a success function Call next request in queue If it fails: Pass responseText or err to error function Stop execution If I