views:

40

answers:

1

So, basically the 255-char limitation of URLs is too short for me, and I don't want to rely on ignoring it.

My request will not change anything on the HTTP server end. I need to send some data with request, that is slightly larger than 1024 characters in size and is NOT of secure/secret character. The server will use the data for verification against a database and return a result of this verification, but nothing is changed. The request is thus said to be idempotent. In pseudecode, client calls RPC:

int verify_data(char[>1024] data)

Can I use POST or will this violate principles of REST and other good HTTP client/server design? I obviously cannot use GET?

A: 

http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-an-url

Do you control the server and the client? If you know that both will handle the length, then I would go ahead and run with it.

Jason
I don't exactly control the server, but will do some checking. A bit of the problem is that I also cannot vouch for exact size of the data to be sent with the request. There has to be a way that does not involve checking whether what will handle what? I mean we are talking HTTP here, which is almost overspecified?
amn
I also read the content linked, and the research concludes that one should not send over 2000 characters. I will DEFINITELY be sending more than that. I don't think GET is what I need. I am indeed "getting" a result, but I am wondering if HTTP has something else for my purposes? As last resort I will have to do an idempotent POST (which is not POST at all per se)
amn
You're over-thinking this. If GET won't handle what you need to do, then do a POST. I don't think you're going to find any other answer.
Jason
Well, your comment is the answer I was looking for in a way. I thought I missed something, but turns out I didn't - there is the GET and its practical limit (I posted a comment with link above) and then there is POST, which is supposed to do something else. HTTP is a bit too rigid it appears, if I had a raw TCP/IP socket client-server, I wouldn't need to think what is idempotency in the first place, I could just pipe data out from client and parse the response.
amn