Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
jquery make a post request
Play lesson

jQuery tutorial for beginners - jquery make a post request

5.0 (2)
25 learners

What you'll learn

This course includes

  • 22.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/06/jquery-make-post-request.html Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 In this video we will discuss 1. How to make a post request using jquery. 2. What is the difference between get and post This is continuation to Part 58, please watch Part 58 before proceeding. To make a get request we use jquery get function. jQuery load function can be used to make either a get or post request, depending on whether the data parameter is specified or not. POST method is used if data is provided, otherwise, GET is used. Another method that is available in jQuery to make a post request is post method. jQuery post function syntax $.post( url [, data ] [, success ] [, dataType ] ) Please note that the syntax of post function is similar to get function To modify the example we worked with in Part 58, to issue a post request simply replace get() function with post function. CHANGE THE FOLLOWING LINE FROM $.get('GetHelpText.aspx', { HelpTextKey: helpDiv }, function (response) { TO $.post('GetHelpText.aspx', { HelpTextKey: helpDiv }, function (response) { At this point if you fire fiddler and inspect the request you will find that a POST request is issued. What is the difference between get and post 1. GET is designed for getting data from the server. POST is designed for modifying data on the server. 2. Both GET and POST can be used to send data to the server. 3. When you are sending data with a GET request, the data is appended to the URL as query strings. With POST request the data is included in the message body. 4. There is a limit on how much data can be sent using a GET request due to the limit on the length of the data that can be passed as part of the URL. The size limitations associated with GET are different depending on the client and server software. So, If you're sending large amounts of data, use POST over GET. If it's just a small amount of data then you may use GET. 5. In general, a GET request should have no side-effects, in the sense that it shouldn't modify data. Usually if we are using a GET request to send data to the server, it should be to retrieve an item with an id. For example, GetCustomer.aspx?id=1, will retrieve a customer with id=1. A lot of people keep asking what is the difference between GET and POST in AJAX Whether you make GET and POST request using AJAX or by some other means is irrelevant, the differences are still the same.

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere