teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

logを出力

2022/02/16 12:08

投稿

shihominorth
shihominorth

スコア46

title CHANGED
File without changes
body CHANGED
@@ -19,6 +19,24 @@
19
19
 
20
20
  ```
21
21
 
22
+
23
+ ### 考えられる原因
24
+
25
+ alamofireの通信内容のlogを出したら、titleがパラミーターの中に入れてたのに出力されていないのでそれが原因だと思います。もしかしたらbody(マークダウン式)の中に```があるのでそれが悪さしているのかもしれないです。
26
+
27
+ ```
28
+ curl -v \
29
+ -X PATCH \
30
+ -H "User-Agent: OAuth/1.0 (<ユーザー名>.OAuth; build:1; iOS 15.2.0) Alamofire/5.4.4" \
31
+ -H "Accept-Encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8" \
32
+ -H "Accept-Language: ja-US;q=1.0" \
33
+ -H "Content-Type: application/json" \
34
+ -H "Authorization: Bearer <アクセストークン>" \
35
+ -d "body=%23% <省略>
36
+ ```
37
+
38
+
39
+
22
40
  ### 該当のソースコード
23
41
 
24
42
  ```Swift

1

返ってきたデータを出力したものを追記

2022/02/14 15:13

投稿

shihominorth
shihominorth

スコア46

title CHANGED
File without changes
body CHANGED
@@ -12,6 +12,13 @@
12
12
  Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.decodingFailed(error: Swift.DecodingError.keyNotFound(CodingKeys(stringValue: "id", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"id\", intValue: nil) (\"id\").", underlyingError: nil)))
13
13
  ```
14
14
 
15
+ 以下が返ってきたデータを出力したものです。
16
+
17
+ ```
18
+ "{\"message\":\"Invalid json\",\"type\":\"invalid_json\"}"
19
+
20
+ ```
21
+
15
22
  ### 該当のソースコード
16
23
 
17
24
  ```Swift