简体   繁体   English

如何在iOS目标C中传递针对PayTm交易的GET请求

[英]How to pass GET request for PayTm transaction in ios Objective C

I am integrating PayTm with my app and I want to pass the parameters using GET method. 我正在将PayTm与我的应用程序集成在一起 ,我想使用GET方法传递参数

My code is as follows: 我的代码如下:

NSString *urlString = [NSString stringWithFormat:@"https://secure.paytm.in/oltp/HANDLER_INTERNAL/TXNSTATUS?JsonData={%22MID%22:%22%@%22,%22ORDERID%22:%22a84afd6c-0e54-42df-b29a-2b057f9e7c53%22}",MIDValue];

where MIDValue is a string. 其中MIDValue是一个字符串。

When I use this code I'm getting error message. 当我使用此代码时,我收到错误消息。

Please give a suggestion to remove the error. 请提供建议以消除错误。

Thank You 谢谢

Maybe your variable MIDValue contains space and/or &. 也许您的变量MIDValue包含空格和/或&。 You first have to encode it as URL and then pass it as parameter. 您首先必须将其编码为URL,然后将其作为参数传递。

Visit this for details, I guess this is what you are looking for 访问此了解详细信息,我想这就是您想要的

NSString *newParam = [MIDValue stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]

NSString *urlString = [NSString stringWithFormat:@"https://secure.paytm.in/oltp/HANDLER_INTERNAL/TXNSTATUS?JsonData={%22MID%22:%22%@%22,%22ORDERID%22:%22a84afd6c-0e54-42df-b29a-2b057f9e7c53%22}", newParam];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从UIWebView传递数据到Objective-C IOS中的本机应用程序 - How to get data from UIWebView pass to Native app in Objective-c IOS 如何获取text / html; charset = utf-8响应iOS Objective C中的请求? - How to get text/html; charset=utf-8 in response of request in iOS Objective C? iOS使用Objective-C使用GET请求保存JSON - ios save json with GET request using objective-c iOS - 如何将数组作为参数传递给AFNetworking(Objective-C) - iOS - How to pass array to AFNetworking as parameters (Objective-C) iOS Swift到Objective-C如何将弱引用传递给数组? - iOS Swift to Objective-C how to pass weak references to arrays? 如何将数据从 javascript 传递到 IOS Objective-c 中的 Z5A98E2840FD0141780D854E48C608D? - how to pass data from javascript to IOS Objective-c in webview? 如何在iOS Objective C中将令牌添加到Rest Web服务请求 - How to add token to a Rest web service request in iOS Objective C 如何将JSON作为正文发送到请求以代替xml iOS目标C - How to send a JSON as a body to a request in place of a xml ios objective c 如何在iOS Objective C中发送包含多部分表单数据的放置请求? - How to send put request with multipart form data in iOS objective c? 如何在iOS中将变量从JavaScript传递到目标C,将目标C传递给Javasctipt - How to pass a variable from javascript to objective C and Objective C to Javasctipt in ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM