Avatar of Maverick_Cool
Maverick_CoolFlag for India

asked on 

Does RESTFUL webservices support POST method

Hi,
Does RESTFUL webservices support POST method.
1. if yes, are there any limitation
2. if not, why?
Web ServicesJava EEJava

Avatar of undefined
Last Comment
gordon_vt02
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

to get a resource , do can we use GET method. The reason is the data will very big, may be 21mb, 2mb...20mb. In any case it will be greater than 255 characters
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

to get or SEND a resource/data , do can we use GET method. The reason is the data will very big, may be 21mb, 2mb...20mb. In any case it will be greater than 255 characters
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You use GET to retrieve a resource. There's no size limit
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

but as per my knowledge, in GET data is pasted in the url rite.
The limit for length of url is 255 characters.
More over if i have to retrieve more amount of data. How to get it from REST.

Basically simple question is how to retrieve data using HTTP post method using REST.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

The length of the url is not related to the length of the data retrievable
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>Basically simple question is how to retrieve data using HTTP post method using REST.

And to be clear about the above: you don't retrieve using POST, as the link shows- you use GET
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

"HTTP GET is designed so that all information necessary for the interaction is part of the URI, thus promoting URI addressability..."

and another site explaining difference between GET and POST.
how a browser uri length is max 255 characters. so that means i cant use get lone data passing or recieving. rite?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>so that means i cant use get lone data passing or recieving. rite?

Sorry - i don't understand the question - please rephrase
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

What it meant as in GET method, data is transferred as a part of URI/URL and max length URI/URL is 255 characters as HTTP/browser standards. Hence I cannot pass large size data in GET, which also restricts in RESTFUL webservices as we are asked to GET method in it.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>What it meant as in GET method, data is transferred as a part of URI/URL and max length URI/URL is 255 characters

Yes, but that's only in (arguably incorrectly implemented) normal HTTP. Data are not transferred *at all* using GET in REST. That's what POST is for
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

great. Ther, this is the confusion. Can you explain it bit more how data is transfered in POST, even if call Method is GET.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

POST has a 'message body' in which the data are transferred *from client to server*. See

http://en.wikipedia.org/wiki/POST_(HTTP)
ASKER CERTIFIED SOLUTION
Avatar of gordon_vt02
gordon_vt02

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Maverick_Cool
Maverick_Cool
Flag of India image

ASKER

hi that gives clear picture. but what i meant by long URI in GET operation means:

http://url....?var1=....(morethan 255 chars)&var2=...(more than 255 chars).........
Avatar of gordon_vt02
gordon_vt02

Then yes, I'd recommend sending those parameters as a POST request.  You'll probably make any REST purist cry doing that, but it should work. ;)
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo