1

Using twitter's rest api, and specifcally the method :

https://dev.twitter.com/docs/api/1/post/statuses/update

I'm trying to post a tweet that will include a user mention ( @[screenname] ). However, it seems as though twitter won't allow me to post any @ sign unless I encode it. I've tried several encoding techniques, but non seem to provide me with the suitable encoding twitter is looking for.

As to the question, What should "@" be substitute with so twitter will allow me to pass the message correctly? I'm posting the command via an iphone app, and from several reasons I cannot use either ios 6 new social integration, nor twitter's api wrapper for ios.

Edit: The encoding techniques I've tried -

Thank you

Community
  • 1
  • 1
vondip
  • 13,809
  • 27
  • 100
  • 156

1 Answers1

0

As it seems I had to specifically percent encode the @ using the following method:

bodyString = [bodyString stringByReplacingOccurrencesOfString:@"@" withString:@"%40"];

Hope it will help someone in the future.

vondip
  • 13,809
  • 27
  • 100
  • 156