http-post

WCF WebInvoke Method POST

回眸只為那壹抹淺笑 提交于 2019-12-04 14:25:54
问题 I have a wcf service, and I want to test posting data to it. But the parameter of my function never gets any values. [OperationContract] [WebInvoke(UriTemplate = "TestPost", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)] int Test(string value); public int Test(string value) //Value stays null { return 0; } The JSON request I send, build using Fiddler2 http://localhost:49633/Service1.svc/TestPost

Send a Base64 encoded image through HTTP Post Request from Android

浪尽此生 提交于 2019-12-04 13:34:52
I am completely lost, I am trying to send a photo via an android app to a php webpage. Theoritically everything should be right but the destination data is corrupted or something I don't know... I can get the post data, I tried with a simple string it worked fine but with a heavy file the data seems corrupted. public class EncodingAndSending extends Thread{ ShareOnMyWebSiteActivity mycontext; ContentResolver cr; Uri uri; public Handler mainHandler,sHandler; public EncodingAndSending(ShareOnMyWebSiteActivity myctxt,Handler mainone,Uri URI,ContentResolver crr){ mycontext=myctxt; cr=crr; uri=URI;

Angular 4 Http POST not working

孤人 提交于 2019-12-04 12:15:35
问题 I hope everyone is doing great. I've recently started working with angular 4.4, i've been trying to post data to my api server, but unfortunately it's not working. I've spent like 2 days on it but still no success. And have already tried 6-7 article even from angular.io. I've tried both Http and Httpclient modules but nothing seems to be working. The problem is, whenever i try to post data to my server, Angular makes http OPTIONS type request instead of POST . this.http.post('http:/

AFNetworking- post request- add simple text to body

主宰稳场 提交于 2019-12-04 11:41:23
问题 How do i add a simple string (no JSON or any other format), to a post request using AFNetworking? The best i've already succeeded was concat with '='. And this: NSURLRequest* request =[myServer multipartFormRequestWithMethod:@"POST" path:@"http://my.server.com" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { NSData *tmp_data = [NSString stringWithFormat:@"%@", @"my_string!"]; [formData appendPartWithHeaders:nil body:tmp_data]; }]; Thanks in advance! 回答1: As

Auth filter redirecting back to original POST request in Laravel

回眸只為那壹抹淺笑 提交于 2019-12-04 11:39:50
问题 It seems that Redirect::guest('login') will only work for GET requests. Ie. it will redirect an authenticated user to the original intended URL (GET). In a situation where there is a POST request, is there a way for the auth filter to continue on to POST to a URL after the user has successfully logged on? A simple example: I want to show a form available to anyone to view. Upon hitting the submit button, the auth filter kicks in which will bring a guest to the login page. After successful

Asynchronous cURL using POST

若如初见. 提交于 2019-12-04 10:53:27
I am making a command line application. I need to send out multiple POST requests via cURL simultaneously after I have performed log in procedures - meaning outgoing requests must send session id etc. The chain of events is as follows: I open cURL connection with curl_init I log in to remote site sending POST request with curl_exec and get returned HTML code as response I send multiple POST requests to same site simultaneously. I was thinking of using something like that: // Init connection $ch = curl_init(); // Set curl options curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); curl_setopt(

RESTful WCF web service POST problem

懵懂的女人 提交于 2019-12-04 10:50:40
I can't pass over parameters to wcf web service. My web method: [OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, UriTemplate = "playersJson2")] List<Person> GetPlayers(string name1, string name2); When I make http post request, I got 200 OK response with correct json form but web service seems to fail to get paramters (name1, name2). Wireshark shows following: Do you see anything wrong? Update: Not sure it matters but my service is using "webHttpBinding" and post request is coming from Android. WCF doesn't support forms/encoded data out-of-the box. The

UnknownHostException when sending HTTPS/HTTP POST from Android Device

浪子不回头ぞ 提交于 2019-12-04 10:27:33
I'm trying to create an HTTP POST to Google servers to obtain the ClientLogin Auth (as described here ). The source code for the post is not a real mystery and I found it here . (I'm sure my post works because using CURL I obtain the Auth) The method is very simple and I've modified the values accordingly, however, I'm getting the following exception when I execute the following line: HttpResponse response = client.execute(post); 06-17 13:44:05.645: WARN/System.err(768): java.net.UnknownHostException: www.google.com 06-17 13:44:05.645: WARN/System.err(768): at java.net.InetAddress

ios http POST (Data and Image): Image not getting posted

我的未来我决定 提交于 2019-12-04 10:18:42
I used the following code to PUSH an image and data into a server. The data is being sent but the image is not received in the server. Can someone spot me if there is an error in my below code which I have used: NSString *urlString = [[NSString alloc]initWithString:[NSString stringWithFormat:@"%@action=savesign",MainURL]]; // set up the form keys and values (revise using 1 NSDictionary at some point - neater than 2 arrays) NSArray *keys = [[NSArray alloc] initWithObjects:@"user",@"poll",nil]; NSArray *vals = [[NSArray alloc] initWithObjects:user,pollid,nil]; // set up the request object

Post/Put/Delete http Json with additional parameters in Jersey + general design issues

我只是一个虾纸丫 提交于 2019-12-04 10:04:27
问题 For some reason, I haven't found any normal way to do the following: I want to Post a json object, and add additional parameters to the call (in this case, an authentication token). This is a simple RESTful server in myUrl/server, which should give access to different resources of a "person" in the url myUrl/server/person/personCode/resourceName. GET is easy, and requires no object, only parameters. The problem arrises when I get to POST - how do I attach the JSON, and keep the other