上传.A预报获取认证
POST
{{BASE_URL}}/runway/uploads最后修改时间: 2 个月前
这里得到 id 在 步骤C上使用,uploadUrls 在步骤B上使用
上传.B执行上传
let res = await fetch( d.uploadUrls[0] //步骤A 中的 uploadUrls
, {
method: 'PUT',
body: file, // 上传文件
headers: {
'Content-Type': d.uploadHeaders["Content-Type"], //步骤A 中的 uploadHeaders
'Accept': '/',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Connection': 'keep-alive'
}
}) ;
请求参数
Header 参数
Authorization
string
可选
示例值:
sk-xxxxx
Body 参数application/json
object {0}
示例
{
"filename": "163-q.jpeg",
"numberOfParts": 1,
"type": "DATASET_PREVIEW"
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
object {0}
示例
{
"id": "4e806398-cd0a-48c6-9ac8-6322ed693785",
"uploadUrls": [
"https://runway-datasets.s3.us-east-1.amazonaws.com/previews/38636c93-c137-4eb7-b983-450f7d0871b1.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=ASIA5PY5AQY4YNAEKQFK%2F20240726%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240726T164242Z&X-Amz-Expires=86400&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEAEaCXVzLWVhc3QtMSJHMEUCIGzXIRC8eW6QRXb4UfI3mGuXHYJhn9WsCLpfOQEdgqiuAiEA2oimEh028yuECo%2B2WoxRZSjgMHfLqNX84uszilG6JKYq8gMI2v%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAEGgw5MjcyMzY5MTY3OTMiDA9mkwGgaSsTQPwikirGA%2BtDGpYH%2FYnSinCTWmnBNbWbKYm01FbTXVXEQhqAHkqpHJ7v8ByDZzIRGmCiqj3k%2BYqYgxkYllH41hrntSCESbM9ci0M3hqypsBCDDReH%2BdEFhG20eOvx4NbnNu8DO34EcTr0XEuHvFhfBB07yBZ%2FkRfyFWAhGrn8FTbfVvTfZONoGr2fNqo31NU%2F%2Bnar%2FToszgHpweA2lVBlZlN5WFFWTSP%2FX77K%2BLW0%2BZr57J%2FzFXrWQG9Vtty9A%2Fbr%2BwcVDO9gv%2FLcRUvs8vUPxxAX5%2ByZ51f%2B8MQvENP0sV7lABj6zYhMYGl2FJO8ASo05T1zGgUod448yE7CkveenR7Jst1%2BmB%2FsD7GcY3HdctBQUYCrodcNOP1m4o51KykFZuwWnhhVx9FG53KalpwPBANgea8%2BXSLTY%2FsjPYITAOWgCoSJ%2FShEYMeJC6T3yxJC04PoBqXAP31hu10koCK7yqWYzNH89BQ4UW8cTriixI8wgAJCmaCCg1Dm3xiJAAznPw7dnPaJdNCjiIik8tM1GBgXkqwTYWzpCJBeSnQVeeBpbxd7RwGib8V3jhawYCfyIa01iw%2B7ZX9C8y3PXi2ncub4VZGj3DfafHIbacwhaCPtQY6pQGelWlBM5Ftg4cdnKOGC6wZboGLp%2BvcU5RCw9j9MoKSrZFA2iQEl2Atnxb5CKrEBZCahy1MJI6kE%2BGQ0hNv4AwLCUvlyWIn9zcdHa162I6hFDccAkkLsr%2FQUT5sgkxqQhH6OzkdOub4sPaRXIIJbWHDqa73nd1xVScVhRvd8GP9ip8cxK0wFitt%2Fu04zr7PuMWIg8I85pEK%2FHu63XLvs5zYyZj5GMc%3D&X-Amz-Signature=c3053c853994e21fb4b9f34d2c5595129344b1ed2606dc953beeb120888c6e19&X-Amz-SignedHeaders=host&x-id=PutObject"
],
"uploadHeaders": {
"Content-Type": "image/jpeg"
}
}
最后修改时间: 2 个月前