1
나는 update_with_media.json을 사용하여 트위터에 이미지를 게시하려고합니다.update_with_media - Lua를 사용하여 이미지를 twitter로 업로드
업데이트하는 작업 코드는 다음과 같은 트윗을 가진 상태/update.json 나는 이미지를 업로드 할 수있는 위의 코드를 수정 어떻게 지금
local url = "http://api.twitter.com/1/statuses/update.json"
local consumer_key = ""
local consumer_secret = ""
local token = ""
local token_secret = ""
local post_data =
{
oauth_consumer_key = consumer_key,
oauth_nonce = get_nonce(),
oauth_signature_method = "HMAC-SHA1",
oauth_token = token,
oauth_timestamp = get_timestamp(),
oauth_version = '1.0',
oauth_token_secret = token_secret
}
post_data["status"] = "Hello Twitter!"
post_data = oAuthSign(url, "POST", post_data, consumer_secret)
r,c,h = http.request
{
url = url,
method = "POST",
headers =
{
["Content-Type"] = "application/x-www-form-urlencoded",
["Content-Length"] = string.len(rawdata)
},
source = ltn12.source.string(post_data),
sink = ltn12.sink.table(response)
}
? URL이 "multipart/form-data"로
그러나이 될 것 "http://api.twitter.com/1/statuses/update_with_media.json"와 헤더 [ "콘텐츠 유형을"] 될 경우와 업로드 할 이미지를 어떻게 지정합니까?