post

How do I access query parameters in the request content body in javascript?

If I use a GET to request a page, then I can access any query parameters from javascript using window.location.search. Is there a similar way to access query parameters which are in the request content body rather than the request location, when the page is a result of a POST? ...

Best way to page asp.net-mvc page with POST

I have an action method that that returns a PagedList<> after a form's POST request. I would like to add paging to this page, but all paging scenarios only seem to work with GET requests. Currently the only way of adding paging controls is adding a bunch of forms with one button for navigating the page. This will look but ugly (all form...

Does it make a difference in security whether a form POSTs to its own file or a different one?

Assuming I do the same field validation in either case, is there any difference in terms of security whether you POST a form back to its own file or to another? Note that I'm not referring to sensitive information or passwords within the form data, but to whether either method is better at avoiding various types of attacks. ...

Safari 3.2.1 sends POST followed by GET requests

I've a servlet running on Tomcat 5.5.27 and 5.5.26 and have a web form with POST method. If I use Safari 3.2.1 I see from the logs that Tomcat receives a POST followed immediately/contemporarily by GET and it fails. If I use Firefox 3.0.5 I see that it sends only POST and everything works. Trying to debug with Eclipse I see that when us...

Python urllib2 file upload problems

Hello everyone, I'm currently trying to initiate a file upload with urllib2 and the urllib2_file library. Here's my code: import sys import urllib2_file import urllib2 URL='http://aquate.us/upload.php' d = [('uploaded', open(sys.argv[1:]))] req = urllib2.Request(URL, d) u = urllib2.urlopen(req) print u.read() I've placed this .py fi...

How can I post data (form) to html page and hijacking the data in the middle?

the site addres: http://www.ynet.co.il/YediothPortal/Ext/TalkBack/CdaTalkBack/1,2497,L-3650194-0-68-544-0--,00.html fill the form with rubbish. Hit 'Send' the form post the data to another HTML without any parsing of the data i've just added How do they do it? ...

RESTful way to create multiple items in one request

I am working on a small client server program to collect orders. I want to do this in a "REST(ful) way". What I want to do is: Collect all orderlines (product and quantity) and send the complete order to the server At the moment I see two options to do this: Send each orderline to the server: POST qty and product_id I actually don...

Performance of HttpWebRequest using POST

I have a small tool I use for testing a webservice. It can either call the webservice using POST or using GET. The code for using POST is public void PerformRequest() { WebRequest webRequest = WebRequest.Create(_uri); webRequest.ContentType = "application/ocsp-request"; webRequest.Method = "POST"; webRequest.Credentials = _cr...

Post from one controller action to another (not redirect)

Hey all! I have an action which I need to post forward onto another action if it meets certain conditions, but I am unable to preserve the form data when passing through to the next action. The receiving action accepts a FormCollection, which the sending action Currently, I am doing a return RedirectToAction("action","controller", fo...

What happens if you go to a GET style url with a POST request?

Let's say I have a page called display.php and the user is viewing display.php?page=3. I want to allow the user to do an action like voting via a POST request and then bring them back to the page they were on. So, If I do a POST request to display.php?page=3 would the page information also be available to the script? ...

which is better to pass a PHP var in AJAX call to another page: POST or through the session?

Hi, in a PHP site I am building, I use a Prototype AJAX call to address some other php page. This called php page needs a variable that lives as a SESSION var on the first page (in the sense that it's used multiple times throughout that page anyway). It's more curiosity than anything else but: which of both ways to pass our variable i...

Array posting in PHP

I am trying to post an array full of checkboxes and to open it in the next page.. It only gives me the last result, anyone know why? or how to fix it? <form name="input" action="createevent.php" method="post"> Event title: <input type="text" name="Eventtitle" size="20"> <br>Event Description <input type="text" name="Description" siz...

REST web service accepting a POST using Restlet - Best Practice

I have my resource and they typical overridden method to handle POST requests. public void acceptRepresentation(Representation rep) { if (MediaType.APPLICATION_XML.equals(rep.getMediaType())) { //Do stuff here } else { //complain! } } What I want to know is the best practice to handle my packet of XML. I see a lo...

Posting contents of a file using HttpClient ?

I want to send the contents of a file as part of a http request using Apache HttpClient and I could not figure out how to pass on the file contents in the request body. ...

Reporting an error from a POST Web Service

I'm developing a web service (in asp.net) and I would like to have each web method report to whoever called it when an internal error occurs - for example when input validation has failed. When I expose my web service with SOAP such errors can be reported by raising a SoapException. But what if I expose my web service with plain POST (...

Handling input with the Zend Framework (Post,get,etc)

Hi, im re-factoring php on zend code and all the code is full of $_GET["this"] and $_POST["that"]. I have always used the more phpish $this->_request->getPost('this') and $this->_request->getQuery('that') (this one being not so much logical with the getquery insteado of getGet). So i was wondering if my method was safer/better/easier t...

How do I separate out query string params from POST data in a java servlet

When you get a doGet or doPost call in a servlet you can use getparameterxxx() to get either the query string or the post data in one easy place. If the call was a GET, you get data from the url/query string. If the call was a POST, you get the post data all parsed out for you. Except as it turns out, if you don't put an 'action' attrib...

PHP HTTP POST fails when cURL data > 1024

Note: solution at the end If I attempt to do a HTTP POST of over 1024 characters, it fails. Why? Here is a minimal example: recipient.php: <?php if (strlen(file_get_contents('php://input')) > 1000 || strlen($HTTP_RAW_POST_DATA) > 1000) { echo "This was a triumph."; } ?> sender.php: <?php function try_to_post($char_count) { $u...

Send Text to a Port Using Javascript

I recently got a new printer (specifically a HP Photosmart C6380 if that helps) that allows me to send text to port 9100 to print. Telnetting into it and typing text to print works fine, but I'm wondering if I could make a webpage using HTML and Javascript that can send text directly to it. I'm currently using the code from the article...

POST XML to URL with PHP and Handle Response

I've seen numerous methods of POSTing data with PHP over the years, but I'm curious what the suggested method is, assuming there is one. Or perhaps there is a somewhat unspoken yet semi-universally-accepted method of doing so. This would include handling the response as well. ...