http-post

Cannot get the value of a textarea via post method [closed]

泄露秘密 提交于 2019-12-05 20:10:34
It is a very simple form as in the code below: <form method="POST" action="news.php?nid=2"> <textarea id="txtcomment" style="width:100%; height: 70px;" maxlength="300"></textarea><br /><br /> <input type="submit" class="button" style="float: right; cursor:pointer;" value="Comment"> </form> but in the news.php i cannot get the value of "txtcomment" echo $_POST['txtcomment']; it returns nothing... It is because you need to name the textarea: <textarea name="txtcomment"></textarea> The id parameter does not have anything to do with how forms work (with the exception of label s, but that is not

RestEasy Client Authentication and HTTP Put with Marshalling

♀尐吖头ヾ 提交于 2019-12-05 19:27:13
I want to test my REST-Service using the RestEasy Client Framework. In my application I am using Basic Authentication. According to the RestEasy documentation I am using the org.apache.http.impl.client.DefaultHttpClient to set the Credentials for Authentication. For an HTTP-GET Request this works fine, I am authorized and I get the result Response which I wanted. But what if I want to make a HTTP-Post/HTTP-Put with an Java Object (in XML) in the HTTP-Body of the Request? Is there a way to automatically marshall the Java Object into the HTTP-Body when I am using the org.apache.http.impl.client

Image(or video) posting to server in Swift

ぃ、小莉子 提交于 2019-12-05 18:44:57
Hi I am posting json data to server using NSURLSession in swift as below var request = NSMutableURLRequest(URL: NSURL(string: "http://mypath.com")) var session = NSURLSession.sharedSession() request.HTTPMethod = "POST" var params2 :NSDictionary = ["email":"myemail@gmail.com"] var params :NSDictionary = ["function":"forgotPassword", "parameters":params2] var err: NSError? request.HTTPBody = NSJSONSerialization.dataWithJSONObject(params, options: nil, error: &err) request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.addValue("application/json", forHTTPHeaderField:

Sending form with POST method and Polymer iron-form?

南笙酒味 提交于 2019-12-05 18:36:02
i use Polymer starter kit 1.0.2 and i'm trying to use iron-form based on (little) documentation i found. My method form is "post" and contain only one input. My form "action" is a PHP script (add.php) showing content of $_GET and $_POST: print_r($_POST); print_r($_GET); My form component (form_eclp.html) is: <dom-module id="my-form"> <template> <div class="horizontal center-center layout"> <div> <div class="horizontal-section"> <form is="iron-form" id="formGet" method="post" action="add.php"> <paper-input name="name" label="Name" required></paper-input> <br><br><br> <paper-button raised

How to add a post parameter to manual form submission?

天大地大妈咪最大 提交于 2019-12-05 18:01:51
I want to submit a form manually after some complicated checks. Because checks involve user interaction, the whole check process is not done synchronously. Here is the scenario: User clicks a button (an HTML <button id='button-id'> tag) I prevent the default action of the button (which is the form submission) I do a complicated check. Somewhere in the check process, I show a dialog and wait for the user to respond (here, the original check function proceeds and returns) I provide a callback function for that dialog, which fires and runs when the user closes it (either positive or negative

HTTP: Why is wrong sending username and password in get request?

拈花ヽ惹草 提交于 2019-12-05 17:07:00
Genaral practice is when you login, or do something else that requires your username and password, you send it in the body of post request. Also for added security https should be used. In get request these parameters are sent as a part of URL. But in https both body and headers are encrypted, as i understand. So in theory, whether you use https post or get for sending, your data are safe..., in one case attacker will have to decript your header and in other your body. So my question is, if this is all true, how is post more secure? Aside what others have already written there is an additional

Configuring HTTP POST request from Nifi

懵懂的女人 提交于 2019-12-05 17:06:36
I am trying to access a WCF service from a REST client. I am sending a POST request from a REST client to a WCF service. For your reference, the detail is as follows. The Service Contract definition is as follows: [ServiceContract] public interface IBZTsoftsensor_WcfService { [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "/data")] string ExecuteModelJson(string inputModel); } And the implementation of this interface is as follows: public string

Post and read binary data in ASP.NET MVC

血红的双手。 提交于 2019-12-05 16:22:46
I have a problem with posting of binary data to server via HttpWebRequest . Here is my client code: var request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "POST"; request.UserAgent = RequestUserAgent; request.ContentType = "application/x-www-form-urlencoded"; var responseStr = ""; var dataStr = Convert.ToBase64String(data); var postData = Encoding.UTF8.GetBytes( string.Format("uploadid={0}&chunknum={1}&data={2}", uploadId, chunkNum, dataStr)); using (var dataStream = request.GetRequestStream()) { dataStream.Write(postData, 0, postData.Length); dataStream.Close(); } And then I

How do I post a file over HTTP using the standard Python library

时间秒杀一切 提交于 2019-12-05 16:21:24
I am currently using PycURL to trigger a build in Jenkins, by posting to a certain URL. The relevant code looks as follows: curl = pycurl.Curl() curl.setopt(pycurl.URL, url) # These are the form fields expected by Jenkins data = [ ("name", "CI_VERSION"), ("value", str(version)), ("name", "integration.xml"), ("file0", (pycurl.FORM_FILE, metadata_fpath)), ("json", "{{'parameter': [{{'name': 'CI_VERSION', 'value':" "'{0}'}}, {{'name': 'integration.xml', 'file': 'file0'}}]}}". format(version,)), ("Submit", "Build"), ] curl.setopt(pycurl.HTTPPOST, data) curl.perform() As you can see, one of the

Authenticity and Integrity of HTTP Requests

江枫思渺然 提交于 2019-12-05 16:00:24
I have an API endpoint where external websites can submit a POST request. What would be the best method to make sure the requests are authentic and also are not tampered with, so they respect the principle of integrity ? Since the data is not valuable such as credit card information, I do not require HTTPS integration. I have had a look at both HMACs and Digital Signatures, and I believe the second option would be better, yet I am unsure if this is the way to go? Similarly, would hashing the request and verifying it on my server be enough? Both HMAC and Digital signature provides integrity and