11.) Which method is used to send data to a server while updating an existing record?
A) http.get()
B) http.put()
C) http.post()
D) http.delete()
12.) What is the purpose of http.delete() in Angular?
A) It removes a component
B) It cancels an HTTP request
C) It deletes data from a server
D) It logs errors
13.) Which RxJS operator is used to retry an HTTP request if it fails?
A) catchError()
B) retry()
C) delay()
D) map()
14.) What does the finalize() operator do in an HTTP request?
A) Runs a function after the request completes
B) Cancels an API request
C) Logs request details
D) Hides errors from the console
15.) How can you set global headers for all HTTP requests in Angular?
A) Using globalHeadersService
B) Using HttpHeaders inside each request
C) Using requestOptions
D) Using HttpInterceptor
16.) How do you cancel an ongoing HTTP request in Angular?
A) By calling httpClient.cancel()
B) By using unsubscribe()
C) By using AbortController
D) By setting { cancel: true } in headers
17.) What is the purpose of tap() in an HTTP request?
A) It modifies the response before returning it
B) It logs or performs side effects without modifying the response
C) It cancels the request
D) It validates the request headers
18.) What is observe: ‘response’ used for in an HTTP request?
A) To observe full HTTP response, including headers
B) To only get JSON data
C) To send a GET request
D) To disable request validation
19.) How do you handle API pagination in Angular?
A) Using serverPagination module
B) Using pageToken in headers
C) Using queryParams
D) Using paginationService
20.) Which method is best for sending large files to a server?
A) http.get()
B) http.post() with FormData
C) http.put() with JSON
D) http.delete()
Related