In this article we will learn about How we make HTTP request in JavaScript. To make an HTTP request in JavaScript, you can use the XMLHttpRequest object or the newer fetch() API.
Here's an example using XMLHttpRequest:
Here's an example using fetch():
Both examples make a GET request to the specified URL. You can use the fetch() function to make other types of HTTP requests, such as POST, PUT, DELETE, etc. by passing in the appropriate method as the first argument.
You May Also Like...
- What is the difference between Asp.net page life cycle and Asp.net Mvc page life cycle?
- Encrypt and Decrypt Username or Password stored in database in ASP.Net using C#
- Get HttpContext.Current.Session value in JavaScript or jQuery in ASP.Net
- How to use Repeater paging in ASP.Net Gridview
- Custom Paging in ASP.Net GridView using SQL Server Stored Procedure
- Prevent Duplicate (Double) record insert into Database in ASP.Net
Post a Comment