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
How to Express Strings in Swift Using Unicode Hexadecimal Values (Utf-16)
How to Convert an Int to a Character in Swift
Alternative to Usernotificationcenterdelegate's Willpresent When App Is in Background
How to Invoke iPhone Maps for Directions with Current Location as Start Address
iOS Uialertview Button to Go to Setting App
Find Current Country from iPhone Device
Autolayout, Unable to Simultaneously Satisfy Constraints
How to Figure Out Which Url Is Being Blocked by App Transport Security
Transition Animation Not Working in Swiftui
Avcapturesession Audio Doesn't Work for Long Videos
Fbsdkaccesstoken Currentaccesstoken Nil After Quitting App
Add a Watermark on Video After Merging Video and Audio Asset into One in Swift3 iOS
Could Not Insert New Outlet Connection: Could Not Find Any Information for the Class Named
How to Get Hour and Minutes from Nsdate