質問編集履歴

2

logを出力

2022/02/16 12:08

投稿

shihominorth
shihominorth

スコア46

test CHANGED
File without changes
test CHANGED
@@ -18,6 +18,24 @@
18
18
  "{\"message\":\"Invalid json\",\"type\":\"invalid_json\"}"
19
19
 
20
20
  ```
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
+
21
39
 
22
40
  ### 該当のソースコード
23
41
 

1

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

2022/02/14 15:13

投稿

shihominorth
shihominorth

スコア46

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,13 @@
10
10
 
11
11
  ```
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
+ ```
14
+
15
+ 以下が返ってきたデータを出力したものです。
16
+
17
+ ```
18
+ "{\"message\":\"Invalid json\",\"type\":\"invalid_json\"}"
19
+
13
20
  ```
14
21
 
15
22
  ### 該当のソースコード