質問編集履歴
3
エラーを更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,13 +164,9 @@
|
|
164
164
|
|
165
165
|
このようになっています。
|
166
166
|
|
167
|
-
|
167
|
+
```Error
|
168
168
|
|
169
|
-
|
170
|
-
|
171
|
-
Response {type: "cors", url: "http://0.0.0.0:8000/business_term/search/", redirected: false, status: 200, ok: true, …}
|
172
|
-
|
173
|
-
body:(...)
bodyUsed:false
headers:Headers {}
ok:true
redirected:false
status:200
statusText:"OK"
type:"cors"
url:"http://0.0.0.0:8000/business_term/search/"
__proto__:Response
|
169
|
+
responseError(Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.})
|
174
170
|
|
175
171
|
```
|
176
172
|
|
2
エラーをレスポンスとして更新しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,17 +164,13 @@
|
|
164
164
|
|
165
165
|
このようになっています。
|
166
166
|
|
167
|
-
エラーとして
|
167
|
+
エラーとしてレスポンスにbodyがありません。
|
168
168
|
|
169
|
-
```e
|
169
|
+
```response
|
170
170
|
|
171
|
-
|
171
|
+
Response {type: "cors", url: "http://0.0.0.0:8000/business_term/search/", redirected: false, status: 200, ok: true, …}
|
172
172
|
|
173
|
-
|
173
|
+
body:(...)
bodyUsed:false
headers:Headers {}
ok:true
redirected:false
status:200
statusText:"OK"
type:"cors"
url:"http://0.0.0.0:8000/business_term/search/"
__proto__:Response
|
174
|
-
|
175
|
-
UserInfo={NSDebugDescription=JSON text did not start with array
|
176
|
-
|
177
|
-
or object and option to allow fragments not set.})
|
178
174
|
|
179
175
|
```
|
180
176
|
|
1
pythonのコードにてレスポンスを記述していませんでした。
test
CHANGED
File without changes
|
test
CHANGED
@@ -140,13 +140,23 @@
|
|
140
140
|
|
141
141
|
cursor.execute(sql)
|
142
142
|
|
143
|
+
data = cursor.fetchall()
|
144
|
+
|
143
145
|
|
144
146
|
|
145
147
|
cursor.close()
|
146
148
|
|
147
|
-
connection.co
|
149
|
+
connection.close()
|
148
150
|
|
151
|
+
|
152
|
+
|
153
|
+
res.status = falcon.HTTP_200
|
154
|
+
|
155
|
+
res.body = json.dumps(data)
|
156
|
+
|
149
|
-
|
157
|
+
print(res.body)
|
158
|
+
|
159
|
+
|
150
160
|
|
151
161
|
```
|
152
162
|
|