ios - Convert NSString to NSData and keep escaped "&" -
i need convert nsstring or nsmutablestring nsdata , keep escaped character it. im escaping character "&" %26 in post field, since im using not rich-full nsmutablerequest im able set httpbody nsdata.
nsmutabledata *body = [nsmutabledata new]; [body setdata:[part1 datausingencoding:nsutf8stringencoding]]; [body appenddata:[escapedstringfield ?]; [body appenddata:[part2 datausingencoding:nsutf8stringencoding]];
request works correctly fails "&", idea proper solution without implementing 3rd party library networking?
update: not necessary paste here. part1 , part2 works fine. there problem value passed in 'escapedstringfield'. part1 ends "&password="
for exmaple while request being made
&password=gryurrh%267444&7444
but value password equal to
gryurrh%267444
at same time
which corrupt request
i have resolved issue myself. answer nsdata+gzip
ps. 2 down votes - reasonable down-votes of course. love people here not have clue doing , how love downvote while don't know answer.
Comments
Post a Comment