BoxKite.Twitter.TweetExtensions.SendTweetWithImage C# (CSharp) Метод

SendTweetWithImage() публичный статический Метод

Sends a Tweet, with status text, with attached image
ref: https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
public static SendTweetWithImage ( this session, string text, string fileName, byte imageData, double latitude = 0.0, double longitude = 0.0, string placeId = "" ) : Task
session this
text string Text of tweet to send
fileName string Name of the file, including extension
imageData byte the image data as a byte array
latitude double
longitude double
placeId string A place in the world identified by a Twitter place ID. Place IDs can be retrieved from geo/reverse_geocode.
Результат Task
        public async static Task<Tweet> SendTweetWithImage(this IUserSession session, string text, string fileName, byte[] imageData, double latitude = 0.0, double longitude = 0.0, string placeId="")
        {
            var parameters = new TwitterParametersCollection
                             {
                                 {"status", text},
                             };
            parameters.Create(place_id:placeId);

            if (Math.Abs(latitude) > 0.0 && Math.Abs(longitude) > 0.0)
            {
                parameters.Add("lat", latitude.ToString());
                parameters.Add("long", longitude.ToString());
            }

            return await session.PostFileAsync(TwitterApi.Upload("/1.1/statuses/update_with_media.json"), parameters, fileName, "media[]", imageData)
                          .ContinueWith(c => c.MapToSingle<Tweet>());
        }

Same methods

TweetExtensions::SendTweetWithImage ( this session, string text, string fileName, Stream imageDataStream, double latitude = 0.0, double longitude = 0.0, string placeId = "" ) : Task