[英]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.