Which header is crucial for making a CORS request to a different domain using HttpClient?
- 'Access-Control-Allow-Origin'
- 'Authorization'
- 'Content-Type'
- 'User-Agent'
The 'Access-Control-Allow-Origin' header is crucial for enabling Cross-Origin Resource Sharing (CORS) when making requests to a different domain. It specifies which origins are permitted to access the requested resource, allowing for secure cross-domain communication.
Loading...
Related Quiz
- Which state management library focuses on simplicity and minimizes boilerplate code?
- Which lifecycle hook is called once when the component is initialized?
- How can you pass data to a dynamically created component?
- You have a shared service that maintains user settings. You notice that different parts of the application have different instances of this service. What could be a possible reason?
- What is the primary purpose of the ControlValueAccessor interface in Angular?