Alt text support with iOS SDK (SLRequest)

ios

#1

I read the documentation for creating alt text using the REST API.(here)

From what I understand, the endpoint (/1.1/media/metadata/create.json) is a POST request with a JSON body.

Unfortunately, it seems that Apple didn’t implement a method for posting a JSON body, request parameters are always FORM encoded.

The method for creating a request is:
+ (SLRequest *)requestForServiceType:(NSString *)serviceType requestMethod:(SLRequestMethod)requestMethod URL:(NSURL *)url parameters:(NSDictionary *)parameters

SDK Documentation

From what I know, it’s the first api in the REST SDK that needs a JSON body and it breaks the compatibility with the iOS SDK. It would be nice to be able to use the alt text api using the SDK.


#2

@benoitsan Thanks for the details. I will make necessary changes to support your usecase.


#3

@tushargj Awesome. That’s a very good news.


#4

@benoitsan You can pass json payload using post param “data”. Give it a try and let us know if you run into any issue. We will add this information to our documentation.


#5

@tushargj Wow, I would never believed that it would be fixed so quickly.
I just made a test and it works! I can read the alt text I sent with /1.1/statuses/show.json.
Thank you very much!