Questions tagged [http-post]

POST is one of the HTTP protocol methods; it is used when the client needs to send data to the server, such as when uploading a file, or submitting a completed form.

POST is one of the HTTP protocol methods; it is used when the client needs to send data to the server as part of the request, such as when uploading a file or submitting a completed form.

In contrast to the GET request method where only a URL and headers are sent to the server, POST requests also include a message body. This allows for arbitrary length data of any type to be sent to the server. A header-field in the POST request usually indicates the message body's Internet media type.

Links

Related

, , , , , ,

8699 questions
1454
votes
19 answers

How to manually send HTTP POST requests from Firefox or Chrome browser

I want to test some URLs in a web application I'm working on. For that I would like to manually create HTTP POST requests (meaning I can add whatever parameters I like). Is there any functionality in Chrome and/or Firefox that I'm missing?
Pascal Klein
  • 23,665
  • 24
  • 82
  • 119
779
votes
35 answers

How do you handle multiple submit buttons in ASP.NET MVC Framework?

Is there some easy way to handle multiple submit buttons from the same form? For example: <% Html.BeginForm("MyAction", "MyController", FormMethod.Post); %> <%…
Spoike
  • 119,724
  • 44
  • 140
  • 158
753
votes
30 answers

How to process POST data in Node.js?

How do you extract form data (form[method="post"]) and file uploads sent from the HTTP POST method in Node.js? I've read the documentation, googled and found nothing. function (request, response) { //request.post???? } Is there a library or a…
Ming-Tang
  • 17,410
  • 8
  • 38
  • 76
624
votes
15 answers

PHP, cURL, and HTTP POST example?

Can anyone show me how to do a PHP cURL with an HTTP POST? I want to send data like this: username=user1, password=passuser1, gender=1 To www.example.com I expect the cURL to return a response like result=OK. Are there any examples?
mysqllearner
  • 13,523
  • 15
  • 43
  • 43
545
votes
13 answers

What is the difference between PUT, POST and PATCH?

What is the difference between PUT, POST and PATCH methods in HTTP protocol?
selva kumar
  • 5,553
  • 3
  • 11
  • 3
407
votes
27 answers

When do you use POST and when do you use GET?

From what I can gather, there are three categories: Never use GET and use POST Never use POST and use GET It doesn't matter which one you use. Am I correct in assuming those three cases? If so, what are some examples from each case?
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
383
votes
6 answers

Send request to cURL with post data sourced from a file

I need to make a POST request via cURL from the command line. Data for this request is located in a file. I know that via PUT this could be done with the --upload-file option. curl host:port/post-file -H "Content-Type: text/xml" --data…
user253202
352
votes
27 answers

How to POST raw whole JSON in the body of a Retrofit request?

This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request? See similar question here. Or is this answer correct that it must be form url encoded…
user3243335
  • 3,521
  • 3
  • 12
  • 4
344
votes
17 answers

How do I POST a x-www-form-urlencoded request using Fetch?

I have some parameters that I want to POST form-encoded to my server: { 'userName': 'test@gmail.com', 'password': 'Password!', 'grant_type': 'password' } I'm sending my request (currently without parameters) like this var obj = { …
texas697
  • 5,609
  • 16
  • 65
  • 131
330
votes
3 answers

How to post data in PHP using file_get_contents?

I'm using PHP's function file_get_contents() to fetch contents of a URL and then I process headers through the variable $http_response_header. Now the problem is that some of the URLs need some data to be posted to the URL (for example, login…
Paras Chopra
  • 4,029
  • 4
  • 21
  • 19
297
votes
13 answers

Pure JavaScript Send POST Data Without a Form

Is there a way to send data using the POST method without a form and without refreshing the page using only pure JavaScript (not jQuery $.post())? Maybe httprequest or something else (just can't find it now)?
John
  • 7,500
  • 16
  • 62
  • 95
286
votes
9 answers

Values of disabled inputs will not be submitted

This is what I found by Firebug in Firefox. Values of disabled inputs will not be submitted Is it the same in other browsers? If so, what's the reason for this?
omg
  • 136,412
  • 142
  • 288
  • 348
276
votes
16 answers

How to add parameters to HttpURLConnection using POST using NameValuePair

I am trying to do POST with HttpURLConnection(I need to use it this way, can't use HttpPost) and I'd like to add parameters to that connection such as post.setEntity(new UrlEncodedFormEntity(nvp)); where nvp = new…
Michal
  • 15,429
  • 10
  • 73
  • 104
233
votes
7 answers

HTTP Request in Swift with POST method

I'm trying to run a HTTP Request in Swift, to POST 2 parameters to a URL. Example: Link: www.thisismylink.com/postName.php Params: id = 13 name = Jack What is the simplest way to do that? I don't even want to read the response. I just want to send…
angeant
  • 2,785
  • 3
  • 17
  • 9
222
votes
11 answers

HTTP POST Returns Error: 417 "Expectation Failed."

When I try to POST to a URL it results in the following exception: The remote server returned an error: (417) Expectation Failed. Here's a sample code: var client = new WebClient(); var postData = new…
Saeb Amini
  • 23,054
  • 9
  • 78
  • 76
1
2 3
99 100