From the course: JavaScript: Ajax and Fetch

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Why are proxy servers necessary?

Why are proxy servers necessary? - JavaScript Tutorial

From the course: JavaScript: Ajax and Fetch

Start my 1-month free trial

Why are proxy servers necessary?

- [Instructor] Building out a basic Ajax request in front end code is a common practice when developing an app. It's a quick and easy process for trying out the request, writing code to work with the response and building out your app around that. But in many cases before you deploy an app for public use, it's necessary to set up a proxy server to handle your Ajax requests. So why are proxy servers necessary? A lot of APIs require the use of credentials like API keys. Without including a key in your request, the server returns a 401 error indicating that your app isn't authorized to access the requested data. To get authorization, you include your API key as part of your request either in the query string or as a header. This lets the web service associate your request with your account. As long as you're still below any quota or limit on your account, the service sends an OK response with the data included. The problem with this setup is that when you include your API key in the…

Contents