http-post

Uploading multiple images with other parameters in Swift

◇◆丶佛笑我妖孽 提交于 2020-01-31 05:13:08
问题 Right now I've been uploading only one image to a server on a server side script through the code given below. Now I have an array of UIImage , I want to know how can I use UIImageJPEGRepresentation(myImageView.image!, 0.1) to post all the images in a UIImageView array? func uploadImage() { let postPictureUrl = NSURL(string: "http://www.23look.com/merchant/verify") let request = NSMutableURLRequest(URL: postPictureUrl!) request.HTTPMethod="POST" let param=[ "mer_name" : shopNameUITF.text!,

Sending an Excel file from backend to frontend and download it at the frontend

故事扮演 提交于 2020-01-25 08:00:05
问题 I had created an Excel file at the backend (Express JS) using Exceljs npm module. I have it stored in a temp directory. Now I would want to send the file from the back-end to the front-end and download it there when the user clicks a button. I am struck on two things 1. How to send the file from the backend to the frontend through an HTTP POST request 2. How to then download the file in the front-end Edited content: I need the front end to be a button that appends the file to it and then

How can I post image from UWP to .NET core web api?

谁都会走 提交于 2020-01-24 20:06:53
问题 Now I have configured for UWP photo post to web api part which is using HttpClient. Uri uri = new Uri("http://localhost:50040/api/Upload"); IInputStream inputStream = await photoFile.OpenAsync(FileAccessMode.Read); HttpMultipartFormDataContent multipartContent = new HttpMultipartFormDataContent(); multipartContent.Add(new HttpStreamContent(inputStream), "myFile", photoFile.Name); Windows.Web.Http.HttpClient newclient = new Windows.Web.Http.HttpClient(); Windows.Web.Http.HttpResponseMessage

Robotframework : How to retrieve the answer of a request

扶醉桌前 提交于 2020-01-24 14:05:07
问题 I would like to test the activation of a user. To validate the creation of a user, I click on a "Valid" button and the front-end requests the back-end to send a POST request. My goal is to retrieve the answer to this query. I have tried these keywords: *** Setting *** Library SeleniumLibrary Library HttpLibrary.HTTP *** Keyword *** !Confirm entry [Arguments] ${id_button} Wait Until Element Is Visible ${id_button} Click Element ${id_button} Response Status Code Should Equal 200 Or *** Setting

POST method, Ajax and Security?

只愿长相守 提交于 2020-01-24 09:14:04
问题 I use Ajax (jQuery) and the POST method to update data in the database. I do the following: Get data from the form: user_id, entry_id, content,... Send them to a URL which will process the data. If the data is valid, we will record them in our database. I do not know how to verify that the user sends data from my website and not from other places. Please help me solve this problem. Thanks ! 回答1: You're trying to defend against CSRF attacks. The standard defense is to have a require a token in

Update webpage after receiving POST request

岁酱吖の 提交于 2020-01-24 07:16:07
问题 I've to tried to find out similar issue in stack overflow, but I couldn't. I am using python requests library to send POST request to my personal domain name www.****.com. r = requests.post('http://www.****.com', data = {'temp1':"Anum"}) print r.text When I run the script, the r.text shows me "Welcome Anum". Where I have written a small php script on my website <?php $data=$_POST["temp1"]; echo "Welcome ". $data. "<br />"; ?> Now the problem is, I am not able to see this get request on actual

415 Unsupported Media Type; Angular2 to API

三世轮回 提交于 2020-01-24 02:28:06
问题 i am new to angular 2 and i'm facing a problem which i cant find a solution: When i try to post from angular 2 to API i get - 415 unsupported media type. Angular 2 code: onSubmit(value: any) { // console.log(value.message); let headers = new Headers({ 'Content-Type': 'application/json'}); let options = new RequestOptions({ headers: headers }); let creds = 'statusuknown'; let body = JSON.stringify(creds); this.http.post('http://localhost:1318/api/ActionItem', creds) .subscribe( () => {console

How to see form data with enctype = “multipart/form-data” in Chrome debugger

泪湿孤枕 提交于 2020-01-24 02:22:50
问题 I'm trying to visualize form data in Chrome Debugger. Data are sent through a from which loads a file and sends some text. Something like this one: <form action="url" enctype="multipart/form-data" method="post"> <input type="file" name="file"> <br> <input type="text" name="some_text"> </form> If I explore the headers of the POST request with dev tools, I do not see form data section but I just find: Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXGBFWL5ab6g5XoFN that,

How to get textbox value in node.js file?

纵饮孤独 提交于 2020-01-23 21:29:06
问题 This is my html code: <form id="fileupload" method="POST" enctype="multipart/form-data"> <div class="row fileupload-buttonbar"> <textarea name="txtFolderName" rows="1"></textarea> <button type="create" class="btn btn-primary start"> <i class="glyphicon glyphicon-upload"></i> <span>Create Folder</span> </button> </div> When I click the "Create Folder" button, I will do some function based on the textbox value. How to get the textbox value to the node.js file during POST method? 回答1: For

Threads and Asynctask task use for httppost

不羁的心 提交于 2020-01-23 11:02:20
问题 Friends ,i need help to android httppost data to server using Asynctask or Threads I need to send data to my server when i click post button.But when i click it app need to go to next page and data need to send through as background process.I'm new to Android.I don't know what is exactly use for this kind of task (Threads or Asyanctask). I tried this code but it will give me exception error public void startProgress(final String name) { // Do something long Runnable runnable = new Runnable()