91516


[Twitter Batch compliance(Compliance Firehose
API)](https://developer.twitter.com/en/docs/twitter-api/compliance/batch-
compliance/introduction)をやろうとしているのですが、手順１でJobの作成ができ、upload_urlを取得まではできたのですが、その次の手順2である`ファイルのアップロード`の方法がわかりません。

ファイルの中身は`ツイートID` or
`ユーザーID`の羅列が必要そうなのですが、そのファイル(データ)をupload_urlにアップロードする方法がわかりません。

どのようにすればよいのでしょうか？

[code]

    let url = URL(string: "https://storage.googleapis.com/twttr-tweet-compliance/1579097950700961793/submission/1468034183536984067_1579097950700961793?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=complianceapi-public-svc-acct%40twttr-compliance-public-prod.iam.gserviceaccount.com%2F20221009%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20221009T131424Z&X-Goog-Expires=900&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=2703915919f8aff425e84f790ad114b81")!
            
    var request = URLRequest(url: url)
        
    var request.httpMethod = "POST"
            
    let tweetIDs = ["1577730467436138524", "1565318587736285184", "1565318587736285184", "1564694842311049217"]
    request.httpBody = tweetIDs.joined(separator: "\n").data(using: .utf8)!
        
    let (responseData, _) = try await URLSession.shared.data(for: request)
    
    print(String(data: responseData, encoding: .utf8)!)
    
[/code]

[code]

    <?xml version='1.0' encoding='UTF-8'?>
    <Error>
    <Code>SignatureDoesNotMatch</Code>
    <Message>
    The request signature we calculated does not match the signature you provided.
    Check your Google secret key and signing method.
    </Message>
    <StringToSign>
    GOOG4-RSA-SHA256
    20221009T131424Z
    20221009/auto/storage/goog4_request
    5c45ee0335cfb583f650af1d68f9fb10b2f72e34aed04a5ca8ad22942a537020
    </StringToSign>
    <CanonicalRequest>
    POST
    /twttr-tweet-compliance/1579097950700961793/submission/1468034183536984067_1579097950700961793
    X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=complianceapi-public-svc-acct%40twttr-compliance-public-prod.iam.gserviceaccount.com%2F20221009%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20221009T131424Z&amp;X-Goog-Expires=900&amp;X-Goog-SignedHeaders=content-type%3Bhost
    content-type:application/x-www-form-urlencoded
    host:storage.googleapis.com
    
    content-type;host
    UNSIGNED-PAYLOAD
    </CanonicalRequest>
    </Error>
    
[/code]


CC BY-SA 4.0
2022-10-09T12:19:39.347
91511
2022-10-09T14:44:55.683
2022-10-09T13:48:49.387
40856
40856
question
swift twitter
Twitter API v2のBatch compliance(Compliance Firehose API)でGoogle API Storageにアップロードする方法がわからない


"POST"ではなく"PUT"でした


CC BY-SA 4.0
2022-10-09T14:44:55.683
91516
2022-10-09T14:44:55.683
40856
91511
answer