草庐IT

post-contentType

全部标签

objective-c - AFNetworking:带有 application/x-www-form-urlencoded 的 POST 请求

我正在学习使用AFNetworking。我知道我可以使用AFHTTPClient通过json发出POST请求。我的问题是:有没有办法发出标准的POST请求(即内容类型为application/x-www-form-urlencoded)?我的服务器后端不接受json,因为客户端应该使用相同的表单通过Web登录。过去我用过ASIHTTPRequest,我用过这段代码:url=[NSURLURLWithString:@"www.example.org/login/"];request=[ASIFormDataRequestrequestWithURL:url];[requestsetPos

ios - 我可以将 "dataWithContentsOfURL"与 "HTTP POST"一起使用吗

目前,我正在使用“dataWithContentsOfURL”向服务器发送数据,并将数据作为HTTPGET请求附加到URL。但是,因为一些数据很多文本,我想从HTTPGET切换到HTTPPOST。因此,我可以将dataWithContentsOfURL与HTTPPOST一起使用吗?有什么例子吗?NSURL*url1=[NSURLURLWithString:concatenatedString];dispatch_async(kBgQueue,^{NSData*data=[NSDatadataWithContentsOfURL:url1];[selfperformSelectorOnMa

ios http POST(数据和图像): Image not getting posted

我使用以下代码将图像和数据推送到服务器中。正在发送数据,但服务器未接收到图像。如果我使用的以下代码有错误,有人能发现我吗:NSString*urlString=[[NSStringalloc]initWithString:[NSStringstringWithFormat:@"%@action=savesign",MainURL]];//setuptheformkeysandvalues(reviseusing1NSDictionaryatsomepoint-neaterthan2arrays)NSArray*keys=[[NSArrayalloc]initWithObjects:@"

ios - 使用 AFNetworking 2 进行 POST 请求时 cocoa 错误 3840

我每次都调用这个函数并返回Cocoa错误3840。我尝试调试并修复它,它在请求时出错,而不是在解析结果时出错我在请求时在失败block中发现了这个错误。ErrorDomain=NSCocoaErrorDomainCode=3840"Theoperationcouldn’tbecompleted.(Cocoaerror3840.)"(JSONtextdidnotstartwitharrayorobjectandoptiontoallowfragmentsnotset.)UserInfo=0x109230960{NSDebugDescription=JSONtextdidnotstartw

javascript - UIWebView 中 PUT 或 POST 类型的 ajax 不传递 HTTP 主体

我正在我的应用程序的UIWebView中打开一个简单的HTML文档:TestingPut$('#testPut').submit(function(ev){ev.preventDefault();varvalue=$('#putValue').val();$.ajax({type:"PUT",url:"data/info/put",contentType:"text/plain;charset=utf-8",data:encodeURIComponent(value),dataType:"text"});});为了简单起见,我从代码中省略了成功和错误处理程序,因为我的问题与真正回复请求

objective-c - 如何使用 Restkit 来 POST JSON 和映射响应

我是第一次使用RestKit,它的功能集看起来很棒。我现在已经多次阅读该文档,并且正在努力寻找一种将JSON参数发布到提要并映射JSON响应的方法。通过在stackoverflow上搜索,我找到了一种通过GET发送JSON参数的方法,但我的服务器只接受POST。这是我目前的代码:RKObjectMapping*issueMapping=[RKObjectMappingmappingForClass:[CDIssueclass]];[objectMappingmapKeyPath:@"issue_id"toAttribute:@"issueId"];[objectMappingmapKe

iphone - 通过http post请求调用ios-Soap方法但响应为空

xx我是iPhone新手。在我的应用程序Soap方法中使用导入和导出数据..虽然导入工作正常但导出不工作来自soapWeb服务的响应是空的..//参数NSString*cust=@"";NSString*trans=@"";NSString*RETURNS=@"";NSString*prepayment=@"";NSString*receipt=@"";NSString*spcode1=@"BB";NSString*companyShortName=@"SampleCompanyLimited";NSString*companyCode=@"01";//SOAP网址:NSURL*url

ios - 带有 IOS : getting multipart data (json + image) via POST 的 Django

我是Django和IOS的新手。我陷入了这种多部分数据传递,需要您的建议!目前,我正在研究图像上传功能。从客户端,我想发送图像文件和附加信息(例如access_token)。在服务器端,我尝试通过request.raw_post_data获取json数据,通过reuqest.FILES获取图像事实证明,我只能获取JSON数据或图像,而不能同时获取两者。更糟糕的是,客户端只返回500错误,没有其他信息...这是客户端代码NSURL*url=[NSURLURLWithString:urlPath];AFHTTPClient*httpClient=[[AFHTTPClientalloc]in

ios - AFHTTPRequestOperationManager POST 请求因网络连接丢失而失败 (-1005)

我的服务器端是使用DJango服务作为API的谷歌计算引擎这是我在xcodeIOS6.1中运行的代码staticNSString*constBaseURLString=@"http://myUrl/";AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManagermanager];manager.requestSerializer=[AFJSONRequestSerializerserializer];[managerPOST:BaseURLStringparameters:[selfgetParameters]

php - React native http post 得到 Json Parse 错误 : Unrecognized token '<'

当我尝试将数据从react-native发布到PHPAPI时,react-native显示错误:JsonParseerror:Unrecognizedtoken'我通过postman使用header类型“application/json”测试了PHPAPI,它工作正常,这是react-native代码,有人可以帮助我吗?提前致谢!importReact,{Component}from'react';import{AppRegistry,StyleSheet,Text,View,ActivityIndicatorIOS,TextInput,TouchableOpacity,}from'r