質問編集履歴

2

修正しました

2021/10/17 14:52

投稿

naoya7081111
naoya7081111

スコア1

test CHANGED
File without changes
test CHANGED
@@ -152,7 +152,7 @@
152
152
 
153
153
  const options = {
154
154
 
155
- url: 'https://object-storage.tyo2.conoha.io/v1/xxxxxxxxxxx/photo',
155
+ url: 'https://object-storage.tyo2.conoha.io/v1/xxxxxxxxxxx/コンテナ',
156
156
 
157
157
  method: 'POST',
158
158
 

1

少し修正しました。

2021/10/17 14:52

投稿

naoya7081111
naoya7081111

スコア1

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- クライアントから送られた画像データをNode.jsのmulter受け取りrequestでconohaオブジェクトストレージにアップロードさせたいです。
5
+ node.jsでHTTPメソッドを使って、conohaオブジェクトストレージに画像をアップロードさせたいです。
6
+
7
+ 今はクライアントからmulterで画像データを受け取り、HTTPメソッドであるrequestでアップロードする流れにしています。
6
8
 
7
9
 
8
10
 
@@ -190,6 +192,46 @@
190
192
 
191
193
 
192
194
 
193
-
194
-
195
- ```
195
+ ```
196
+
197
+ ### 試したこと
198
+
199
+ requestのgetメソッドでオブジェクトストレージへの接続は確認できました。
200
+
201
+ ```node
202
+
203
+ // オブジェクトストレージへの接続
204
+
205
+ const headers = {
206
+
207
+ 'X-Auth-Token': token,
208
+
209
+ 'Accept': 'application/json'
210
+
211
+ };
212
+
213
+
214
+
215
+ const options = {
216
+
217
+ url: 'https://object-storage.tyo2.conoha.io/v1/xxxxxxxxxx/コンテナ',
218
+
219
+ headers: headers
220
+
221
+ }
222
+
223
+
224
+
225
+ httpRequest.get(options, function (error, result, body) {
226
+
227
+ console.log(`resultStatus: ${result.statusCode}`)
228
+
229
+ })
230
+
231
+ ```
232
+
233
+ ```
234
+
235
+ resultStatus: 200
236
+
237
+ ```