根据linkedin文档,上传视频有3个步骤。
我能够成功注册上传请求。
响应:
guard let firstCell = app.cells.allElementsBoundByIndex.first, let topButton = firstCell.buttons.allElementsBoundByIndex.last else { XCTFail("no reoder btn for first cell"); return }
guard let bottomCell = app.cells.allElementsBoundByIndex.last, let bottomButton = bottomCell.buttons.allElementsBoundByIndex.last else { XCTFail("no reoder btn for last cell"); return }
topButton.press(forDuration: 0.5, thenDragTo: bottomButton)
我正在使用以下卷曲请求上载资产
{
"value": {
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
"headers": {
"x-amz-server-side-encryption-aws-kms-key-id": "xxxx-xxxx-xxxx",
"x-amz-server-side-encryption": "aws:kms",
"Content-Type": "application/octet-stream"
},
"uploadUrl": "https://video-uploads-prod.s3-accelerate.amazonaws.com/KEY1/aws-userUploadedVideo?X-Amz-Algorithm=[ALGORITHM]&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption%3Bx-amz-server-side-encryption-aws-kms-key-id&X-Amz-Expires=86400&X-Amz-Credential=[CREDENTIAL]&X-Amz-Signature=[SIGNATURE]"
}
},
"mediaArtifact": "[ARTIFACT]",
"asset": "[ASSET]"
}
}
但是获得响应并禁止错误403
curl -X POST \
'https://video-uploads-prod.s3-accelerate.amazonaws.com/KEY1/aws-userUploadedVideo?X-Amz-Algorithm=[ALGORITHM]&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption%3Bx-amz-server-side-encryption-aws-kms-key-id&X-Amz-Expires=86400&X-Amz-Credential=[CREDENTIAL]&X-Amz-Signature=[SIGNATURE]' \
-H 'Content-Type: application/octet-stream' \
-H 'x-amz-server-side-encryption: aws:kms' \
-H 'x-amz-server-side-encryption-aws-kms-key-id: xxxx-xxxx-xxxx' \
-F upload-file=@/Users/kaushik/Downloads/videoplayback.mp4
要成功在linkedin中上传视频,我该怎么做。
我发现了几年前当linkedin不支持视频时问过的同样问题。
答案 0 :(得分:0)
可能使用错误的curl,与api无关。在终端上尝试同样的方法即可。