473,804 Members | 3,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the difference between Ajax POST and GET


Hi Everybody,

As all knows the difference between GET and POST is in the way how
the data is transfered,

But in case of ajax Though it may be a post Request we need to
format a querystring manually and send with the url,

My question is there any other way that without sending the query
string can we get the post values as in a normal form submit.
regards
Moses

Feb 20 '07 #1
6 3936
mo************@ gmail.com wrote:
Hi Everybody,

As all knows the difference between GET and POST is in the way how
the data is transfered,

But in case of ajax Though it may be a post Request we need to
format a querystring manually and send with the url,

My question is there any other way that without sending the query
string can we get the post values as in a normal form submit.
regards
Moses
Check out CURL.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Feb 20 '07 #2
On Feb 20, 11:58 pm, "mosesdinaka... @gmail.com"
<mosesdinaka... @gmail.comwrote :
Hi Everybody,

As all knows the difference between GET and POST is in the way how
the data is transfered,

But in case of ajax Though it may be a post Request we need to
format a querystring manually and send with the url,

My question is there any other way that without sending the query
string can we get the post values as in a normal form submit.

regards
Moses
I only see difference when you retrieve data in PHP/servers side.
i.e $_POST and $_GET.

Feb 21 '07 #3
Rik
On Wed, 21 Feb 2007 15:36:29 +0100, Satya <sa********@gma il.comwrote:
On Feb 20, 11:58 pm, "mosesdinaka... @gmail.com"
<mosesdinaka... @gmail.comwrote :
>Hi Everybody,

As all knows the difference between GET and POST is in the way how
the data is transfered,

But in case of ajax Though it may be a post Request we need to
format a querystring manually and send with the url,

My question is there any other way that without sending the query
string can we get the post values as in a normal form submit.

regards
Moses

I only see difference when you retrieve data in PHP/servers side.
i.e $_POST and $_GET.
That is not entirely true.
A GET request has al it's values in the requested url in the protocol.
This means it's limited in size. A POST request has the POST values in the
body of the request. This means a difference in formatting the data.

--
Rik Wasmus
Feb 21 '07 #4
C.
On 20 Feb, 18:58, "mosesdinaka... @gmail.com"
<mosesdinaka... @gmail.comwrote :
Hi Everybody,

As all knows the difference between GET and POST is in the way how
the data is transfered,
No - there is a difference in how its transfered but there are several
syntactic and semantic differences.
>
But in case of ajax Though it may be a post Request we need to
format a querystring manually and send with the url,

My question is there any other way that without sending the query
string can we get the post values as in a normal form submit.
Yes - although:
1) it's nothing to do with PHP
2) it won't work everywhere

If you post (pvar=3) to a url with a query (http://www.example.com/?
gvar=splodge) the relevant variables will appear in the _POST and _GET
arrays. All variables will appear in _REQUEST.

If you look at you javascript which actualy makes the request it will
typically decide at runtime whether to create a document or use
xmlhttprequest.

If it does something like this:

requestor = document.implem entation.create Document(blah,b lah,blah);

then you can't (AFAIK) post.

if on the other hand it does this:

requestor = new XMLHttpRequest( ); - for a sensible browser
requestor = new ActiveXObject(" Microsoft.XMLHT TP"); - for MSIE
requester.open( "GET"...

just amend the javascript to something like:
requestor.open( "POST",URL,asyn c);
reqestor.setReq uestHeader('Con tent-type','applicat ion/x-www-form-
urlencoded');
(if your using async, set a callback)
requestor.send( 'posted=somethi ng&othervar=4') ;

HTH

C.

Feb 21 '07 #5
C.
On 21 Feb, 15:05, Rik <luiheidsgoe... @hotmail.comwro te:
>
That is not entirely true.
A GET request has al it's values in the requested url in the protocol.
This means it's limited in size. A POST request has the POST values in the
body of the request. This means a difference in formatting the data.
IIRC the HTTP protocol does not limit the size or a URL - but MSIE
does (to about 2kb)

C.

Feb 21 '07 #6
Thanks Colin and to All.

Moses

Feb 23 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2076
by: G Matthew J | last post by:
interesting "signal vs. noise" blog entry: http://37signals.com/svn/archives2/whats_wrong_with_ajax.php
5
20091
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great with Firefox,but with IE6 the onFailure never gets called and the request never completes. My code: var ajaxReq = new Ajax.Request( url, {method: 'post', parameters:
9
3689
by: GTi | last post by:
I have a bizare Ajax POST problem. I use Ajax POST to send data to the server. The server get the POST and answer back. BUT if I POST the data once again I recieve the same answer that the first post give me, even if the answer is different. I have used HTTP Analyser Std V2.1.1.15 and I see that the answer is different. But the Ajax .responseText is the same as the first POST. It looks like it use the cached respons. In the RFC the...
3
1598
by: Angel Of Death | last post by:
A postback and a callback. Does a callback always avoid a page being re-sent in it's entirety back to the client and does a post-back always force a browser to reload an entire page? Is this my right understanding? If so, why is it that people say that a callback is a postback.
2
3174
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
7
10297
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still lack some JavaScript solid knowdlege) The problem is that when I try to send a form's content with Ajax (I'm using the prototype library), for some reason the latin characters (accents and stuff, like áéíóú) turn a mess when I try to store them in...
8
1539
by: Thomas Hansen | last post by:
Michael Schwarz the guru behind Ajax.NET Professional has in his latest blog officially declared that he is ABANDONING the project... : ( Read up more here; http://ajaxwidgets.com/Blogs/thomas/ajax_net_professional_is_dead.bb
3
2610
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have submitted an HTML form (which contains dynamic textboxes and dynamic checkboxes with a Post Button(input type="button")) by using Ajax function. (onClick="return ajaxFunction(document.getElementById('formid'));") In the ajax function, i have collected...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.