How to Send Multiple Parameterts to PHP Server in Http Post

How to send multiple parameterts to PHP server in HTTP post

For the network operation these is better supporting API like AFNetworking available witch work async and way better to handle

Tutorials for AFNetworking

Get from here

NSArray *keys = @[@"UserID", ];
NSArray *objects = @[@(userId)];

NSDictionary *parameter = [NSDictionary dictionaryWithObjects:objects forKeys:keys];

AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:
[NSURL URLWithString:BaseURLString]];
[httpClient setParameterEncoding:AFJSONParameterEncoding];
[httpClient registerHTTPOperationClass:[AFJSONRequestOperation class]];

NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST"
path:@"services/UserService.svc/GetUserInfo"
parameters:parameter];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[httpClient registerHTTPOperationClass:[AFHTTPRequestOperation class]];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {

NSError* error = nil;
id jsonObject = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:&error];
if ([jsonObject isKindOfClass:[NSDictionary class]]) {
// do what ever
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {

}];

Trying to post web server PHP, multiple parameters not working VB

You are missing a delimiter between your parameters. This code...

Dim upString As String = "future01=" & dateformat3 & "StudentNumber=" & StudentNOString

...will produce output like this:

future01=9/29/2021 10:00StudentNumber=123

Passing multiple parameters by POST using ajax to php

You need to use an ampersand, just as if it was a GET. Further, you should encode your text to make sure that it doesn't contain any characters that could have a special meaning

var the_data = ''
+ 'select=' + window.encodeURIComponent(sv)
+ '&text=' + window.encodeURIComponent(searchtext11);
// ^ ^^

You don't need to decode manually server-side because you are already letting it know that POST data is x-www-form-urlencoded.

how to send multiple parameters using MultipartUploadRequest

thanks everybody I find my problem ,I had to write isset for every post

if(isset($_POST['name']) and isset($_FILES['image']['name'] and isset($_POST['bossname']) and isset($_POST['field']))... 


Related Topics



Leave a reply



Submit