回答編集履歴

1

追記

2018/07/31 09:41

投稿

asm
asm

スコア15147

test CHANGED
@@ -27,3 +27,71 @@
27
27
  を `CiscoSpark.configure`直前にでも追加して実行すると
28
28
 
29
29
  標準エラー出力に通信内容が出力されるハズです
30
+
31
+
32
+
33
+
34
+
35
+ ---
36
+
37
+ **追記**
38
+
39
+
40
+
41
+ ```ruby
42
+
43
+ class CiscoSpark::Api
44
+
45
+ def do_post
46
+
47
+ post_request = request(Net::HTTP::Post)
48
+
49
+ # post_request.set_form_data(request_body)
50
+
51
+ post_request.body = request_body.to_json
52
+
53
+ debug(post_request) if CiscoSpark.debug
54
+
55
+
56
+
57
+ response = http_client.request(post_request)
58
+
59
+ debug(response) if CiscoSpark.debug
60
+
61
+
62
+
63
+ response
64
+
65
+ end
66
+
67
+ def do_put
68
+
69
+ post_request = request(Net::HTTP::Put)
70
+
71
+ # post_request.set_form_data(request_body)
72
+
73
+ post_request.body = request_body.to_json
74
+
75
+ debug(post_request) if CiscoSpark.debug
76
+
77
+
78
+
79
+ response = http_client.request(post_request)
80
+
81
+ debug(response) if CiscoSpark.debug
82
+
83
+
84
+
85
+ response
86
+
87
+ end
88
+
89
+ end
90
+
91
+ ```
92
+
93
+
94
+
95
+ で、多分直るはず
96
+
97
+ 上のデバッグ出力のやつは消してもいいです