storylink://posting?post=[post]&appid=[appid]&appver=[appver]&apiver=[apiver]&appname=[appname]&urlinfo= [urlinfo]
형태의 API 사용하려 합니다.
여기서 post 값에 url 이 들어가는데
url 정보중 &가 들어간 경우 포스팅시 첫번째 & 이후 잘려서 포스팅 되는 현상이 있는데 해결방법이 궁금합니다.
예를들어 http://aaaa.com?a=1&b=2&c=3
형태일때 http://aaaa.com?a=1 까지만 포스팅이 됩니다.
앱에서 호출할때 [[UIApplication sharedApplication] openURL 함수를 쓰고 있습니다.
post값 내용은 모두 utf8 인코딩 하였습니다.
@zakky78 url 인코딩 하셨나요??
인코딩이 잘 안된것 같은데요~ 코드 볼 수 있나요?
NSString *StringByAddingPercentEscapesForURLArgument(NSString *string) {
NSCharacterSet *customAllowedSet = [[NSCharacterSet characterSetWithCharactersInString:@":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"] invertedSet];
return [string stringByAddingPercentEncodingWithAllowedCharacters:customAllowedSet];
}
LinkSample 참고 하시면 더욱 좋습니다.
StoryLinkHelper 클래스가 스토리 링크를 만들고 보내주는데 도움을 줄것입니다.
1개의 좋아요
읔… 말씀해주신거 적용했더니 잘됩니다 ㅠㅠ
해당 url 만 별도로 인코딩했어야 했는데 전체를 string 인코딩하는바람에…
말그대로 인코딩 실수 였네요.
답변 감사드립니다.
1개의 좋아요