Difference between GET and POST Method

Http protocol supports the following methods to retrieve data such as get, post, put, delete etc. In this article, I will tell you about the difference between GET and POST methods.

These methods are basically used to get and send any data. Because of these methods, the request-response between server and client exist. To send data streams we use these two methods. GET and POST are the most common HTTP methods.

Difference between GET and POST Method

GETPOST
We add parameters in URL and get data in response.Send additional data from the client or browser to the server.
Sends data as part of URI (uniform resource identifier)Sends data as HTTP content.
get return same results every time.The post method implements in that way it changes with every request.
We can send limited data in the header. We can send a large amount of data because its part of the request body.
It is not much secure because data is exposed to URL and we can easily bookmark it and send it. It  is more secure because data is passed in the request body and user not able to bookmark it
You can cache the data.You cannot cache post request data.
GET is bounded by the max. URL length continued by the browser and web server.POST doesn’t have such conditions.
GET is used to request data from a particular resource.POST is used to send info to a server to create/update a resource.
parameters passed  in URLparameters passed in body
This is not happening in get method.Use POST for destructive things such as creation, editing, and deletion.
get is used for fetching documents.post used for updating data.
in get we pass things like customer id, uId to get a response.post request sends information to server like customer info, file upload etc.

Check out the example of both requests.

GET Request:

GET https://api.github.com/users/{name}

Here you can pass name according to that you will get data.

GET https://api.github.com/users/sniper57

POST Request:

In this you will have to send content-type such as multipart/form-data, application/json,  application/x-www-form-urlencoded and object or data that you have to pass in body.

Host: foobar.example

Content-Type: application/json

Object- [{name1:value1},{name2:value2}]

In this you are posting JSON data to API.

Comment down below if you have any queries related to get vs post methods.

5 Facile Yet Incredibly Valuable Ways to Enhance ASP.NET Developer’s Efficiency

The ASP.Net Development has arguably redefined and restructured the ambit of web application development. The new age capabilities of the platform created by Microsoft has features abound of developers to let them think out of the box and create something that paves way for innovation. Creating exclusive application become a prospect rather too realistic and as more number of developers and development companies lean towards ASP.NET, we are sure to witness better and faster web apps.

The framework is also continuously changing and it is being made sure that there are regular upgrades. For an enterprise providing the ASP.NET development services to a client – locally or offshore – it is imperative to keep glued to those changes and let them not surprise them and the clients. To upgrade themselves to the changes, developers need to rise up to the occasion and raise their skill levels and optimize the way they work. There are ways to do so, and those ways are met with certain challenges as well. But they also produce favorable results for businesses. So, here is how you can proceed to hone your results as a developer:

Also Read: http://blogs.magistechnologiesinc.com/5-things-you-must-consider-before-using-asp-net-development/(opens in a new tab)

Make Handling the Requests an Asynchronous Exercise

The customary practice in ASP.Net Development is managing the incoming request synchronously. While this kind of process has its set of benefits, you cannot set priorities with this practice, which leads to mismanagement of time. As the requests are placed in a queue, there is a method to how they are handled. So far, so good, but the lack of prioritization only works the other way for you – the wrong way that is. By using asynchronous pages, you can reduce the total request handling time and let more important applications to run first. 

Use the Browser’s Tools and Extensions

The browsers like Google Chrome and Mozilla Firefox comes with their own set of tools to help developers spend less time in writing darn-out codes and plug their applications with incredible features. The oversight leaded to ignoring these tools will only lead to increased time in developing apps and probably lesser efficiency as well. Look for the tools that are relevant to the app and leverage them in the best way you can. 

Pool the connections to Free up Some Resources

The way applications are connected to the database eats up a lot of resources, which can otherwise be saved by the more optimized practice of connecting pooling. It also helps the TCP connections, though keeping an eye towards
discrepancies like connection leaks becomes more imperative. 

Do not Keep Debuggers Running at All Times

While ASP.NET works in a great way to make sure the errors do not creep in and go unnoticed through the use of various debuggers and tracers to let you know, they also have an impact over the application development speed metrics. If you keep them on, the debuggers will render the whole process slow and bring a marked difference in the way applications are being executed. This further impacts the performance – a not too desirable prospect by any stretch. As and when you need it, you can switch on the debuggers to locate and correct the errors to make sure they don’t surface at run-time. 

Make the Most of Cache Class

Developers, both beginners and experts, often undermine the importance of the cache class. In fact, they ignore the benefits that the overall caching mechanism can provide them with. This mechanism is highly important for making a backup of resources while classifying their validity. The cache class makes this process be carried out with ease. As and when an object is not allowed to cache, the callbacks are summoned. With a nod to the growing evolvement of ASP.NET, developers feel the heat to stay abreast to the latest and most resourceful practices. And if they happen to be a part of a large scale ASP.NET development company, there is an escalated urgency.

5 Things You Must Consider Before Using ASP.NET Development

Today’s contemporary web needs expect you to opt for a programming framework that comes loaded with remarkable benefits. Before choosing a particular framework, you must gauge it in terms of ease-of-use and scalability. Amongst the wide range of programming frameworks available in the web market, ASP.NET has been successful in making it to the list of leading web development frameworks used by web developers across the globe. If you too are about to leverage ASP.NET features for building remarkable web solutions then this is a post you can’t afford to miss. Here, I’ve covered five vital things that you must consider before using ASP.NET as your web development tool.

1. High-grade scalability

For being able to make the most of a web development framework, you must ensure that the same is equipped with high-end scalability options. The more scalable the framework is, the better it would be for you (as a developer) to manage the events and sessions across multiple servers used during web development.

If your web programming framework comes with top-level scalability, you can stop worrying about scaling your web application in accordance to forthcoming advancements in the field of technology. ASP.NET features such as pipeline optimization and process configuration aid you in addressing the varying requirements as your project scales from one stage to another.  

2. An efficient web server

The prime reason behind the increased use of ASP.NET is its excellent web server efficiency. Backed by a brilliant web server, ASP.NET enables you to deal with different web development scenarios in addition to offering you the flexibility of monitoring web pages, modules and specific components. To sum it up, with ASP.NET, you need not stress about the speed of the web server because the framework handles the dedicated memory which is required for building web applications and further protecting the application from a wide array of irregularities and security infringements that might occur during the development process. 

3. Commendable speed

Speed is something that can render more power and authority to the web developers. If you are going with ASP.NET, you can expect quick and prompt arrangement of controls and facilities. Equipped with tables, easy-to-handle grids and wizards, ASP.NET offer you a suite of navigation, allowing you to execute web development projects smoothly. Eliminating the need for configuring a web server, ASP.NET permits you to get started with the app coding process rightaway.

Since ASP.NET runs on its own web server, you need not worry about configuring a new server on your system. The framework automatically spins a web server for your use. This is indeed a feature unavailable in a variety of other web app programming frameworks.

4. Lesser coding

Unlike a wide collection of web app development frameworks, ASP.NET comes with brilliant functional capabilities, thereby eliminating the need for any lengthy and complex coding. Features such as:WYSIWYG editing, drag-and-drop server controls and multi-lingual support make ASP.NET a framework worth working with. These features make ASP.NET a viable option for both professionals as well as the beginners who’ve just started using the framework for developing out-of-the-box web applications.

5. Trustworthy and consistent

With authentication and data validation serving as two strong assets of ASP.NET, it won’t be wrong to call it as one of the most reliable web development systems. Rich in streamlined components, ASP.NET allows a web program to automatically detect and recover from bugs, followed by acting in the right way. Issues such as crash protection, dead locks and memory leaks are being addressed well by ASP.NET.

As a web developer, you’ll no longer have to worry about system exceptions and all the scrubbing incoming data during web app development. ASP.NET is already designed to handle all this and much more for you. All you need to do is delve into some easy coding and you’re done with building a perfect web solution.

Wrapping it all up

The aforementioned pointers are just the tip of an iceberg. There’s a lot more to explore with the ASP.NET programming framework. If you’re looking forward to develop rich and expensive web applications then ASP.NET is the platform you can choose without giving a second thought. Looking at the ever-growing demands of today’s clients, ASP.NET is the tool that will help you meeting every type of web app development requirement.

Create Dynamic Menu in ASP.NET MVC – A Complete How to Guide


A menu plays a significant role in lending an amazing UX by making an application easily navigable. It can be used to make accessibility to a particular section a breeze.If you want to ensure a surefire application, it is essential that elements of your application must be accessed with ease. It must appear intuitive and intriguing, so that users can execute them with a flair. You may create multiple modules within a project and depending upon the user’s permissions, an appropriate menu can be implemented dynamically via ASP.NET.

ASP.NET is an open source server side framework that augments web app development with great efficiency and precision. It is the core of the popular Content Management Systems (CRM), eCommerce, and so forth that deliver utile features.

Here is a comprehensive guide that offers a complete tutorial for creating a user-friendly dynamic menu via ASP.NET MVC. The process is extremely simple with only 5 easy steps at a glance.

Let’s distill the process and explore how dynamic menus can be created efficiently.

Create Dynamic Menu in ASP.NET MVC

Step 1: Create a database table

To create dynamic menus in ASP.NET MVC, the very first step is to generate a database table that can hold all the menu items in a designed hierarchy (if any). The database table can be created with a simple query as mentioned below.

Create Table Menus(ID int Primary Key Identity(1,1), ParentID int foreign key References Menus(ID), Title varchar(50), Description varchar(250))

This query will create a table Menus that will hold four values. These values are:

ID: is the primary key and auto generated
Parent ID: is the foreign key
Title: Name of the field
Description: is the information that you want to display when a user hovers over the menu.

With this, a desired table will be created in the database.

Step 2: Insert values into the table

A simple insert query can be used for adding the data into the table. Now, there are two possibilities, that is, your menu may possess multiple parent items that further possess child items or there may be parent items only. So, you must insert the values as per your app requirements.

Query to insert values into the table Menus.

Insert Into Menus(null, ‘Item One’, ‘Desc’) // First Parent Item
Insert Into Menus(null, ‘Item Two, ‘Desc’) // Second Parent Item
Insert Into Menus(null, ‘Item Three’, ‘Desc’) // Third Parent Item
 
Insert Into Menus(1, ‘Item Sub One’, ‘Desc’) // Child of First Parent Item
Insert Into Menus(2, ‘Item Sub Two’, ‘Desc’) // Child of Second Parent Item
Insert Into Menus(3 ‘Item Sub Three’, ‘Desc’) // Child of Third Parent Item

By implementing the above mentioned queries, your Menus table will contain three items in the Menu and each item will further have a child item.

Step 3: Fetch the data from the table

Now, the next step is to fetch the menu items from the table Menus that was created in the step 1, and return a list of all the items.

For this, a GetMenus() function is created in MyMenu class. In this function, there is a loop that will help fetch the items of the Menu and return them via a list. The lines of code for the same is as follows.

Code Snippet for model:

public static class MyMenu
{
   /// <summary>
   /// Get List of All Menu Items from Database
   /// </summary>      
   /// <returns>Returns List<Menus> object</returns>
   public static List<Menus> GetMenus()
   {
       using(var context = new ProjectEntities())
       {
            return context.Menu.ToList();
        }
    }
}

Step 4: Display the created menu on the screen

Now, when the Menu items has been fetched from the database, it is the time to represent it in the view.

Code Snippet for View:

@{
    List<Menus> myMenu = MyMenu.GetMenus();
    var plist = myMenu.Where(m => m.ParentID == null).ToList(); // This will list main menu items on which we’ll apply loop to display them.
    if (plist != null && plist.Count > 0)
    {
        <ul class=”nav”>
        @foreach (var pitem in plist)
        {
            <li>
                <a href=”{URL-Required} title=”@Description”>@pitem.Title</a>
                @{
                    var clist = myMenu.Where(m => m.ParentID == pitem.ID).ToList();
                    if (clist != null && clist.Count > 0)
                    {
                        <ul>
                            @foreach (var citem in clist)
                            {
    <li><a href=”{URL-Required}”title=”@Description”>@citem.Title</a></li>
                            }
                        </ul>
                    }
                }
            </li>
        }
        </ul>
    }
}

Here, ui and li HTML tags are used in the loop. This will help display the created menu in the view. Now, move to the next step.

Step 5: Beautify the menu to make it appear captivating

To ensure an enticing and easily readable menu, it is essential to make it appear visually appealing and intriguing. You may use the CSS appropriately to enhance the look and feel of the menu in a desired fashion. Here, I have incorporated the following chunk of code in the CSS file to boost the navigation ease and ensure an attractive Menu.

Code Snippet CSS:

ul, ol, li {list-style: outside none none;}
.nav {float: left;padding: 0;background-color: #5eab1f;}
.nav li {display: inline-block;position: relative;vertical-align: middle;}
.nav li:hover, .nav li.active {background-color: #4c9312;}
.nav li a {color: #fff;float: left;font-size: 15px;padding: 16px 14px; text-decoration: none;}
.nav li ul {background-color: #fff;border-radius: 0 0 5px 5px;box-shadow: 0 2px 3px #000;display: none;min-width: 200px;padding: 20px 0;position: absolute;top: 48px;z-index: 9999;}
.nav li ul:before {border-bottom: 8px solid #fff;border-left: 8px solid transparent;border-right: 8px solid transparent;content: “”;left: 28%;position: absolute;top: -8px;}
.nav ul li {float: left;width: 100%;}
.nav ul li a {color: #333;float: left;font-size: 15px;padding: 10px 5%;width: 90%;}
.nav li:hover, .nav li.active {background-color: #4c9312;}

This CSS has been created considering a few requirements, you may develop it in a desired fashion to bring substantial changes in the visual appearance. Therefore, you may streamline the CSS as per your UX and design needs.

Wrapping Up

By following this absolute guide, you can efficiently create beautiful dynamic menus via the ASP.NET MVC. It is advisable to thoroughly go through each step and design desirable menu while ensuring utmost navigation ease.