Skip to content

Commit

Permalink
fix:modify the way of request is post
Browse files Browse the repository at this point in the history
  • Loading branch information
路曼 committed Aug 15, 2022
1 parent d982027 commit 5b32a75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
bp.add_url_rule(
"/findJob",
view_func=v.FindJob.as_view(name="findJob"),
methods=["GET"],
methods=["POST"],
)
bp.add_url_rule(
"/recruit",
view_func=v.GetParseResult.as_view(name="recruit"),
methods=["GET"],
methods=["POST"],
)
3 changes: 1 addition & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def load_data(fp):
continue
data.append(line[0])
print(len(data))
print(data)
return data


Expand All @@ -28,7 +27,7 @@ def test_special_example(data):
result = []
start_time = time.time()
for text in data:
ret = requests.get(url, data={"text": text})
ret = requests.post(url, data={"text": text})
res = json.loads(ret.text)
if not res:
continue
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
app.secret_key = "sdfsdfasdf"


@app.route("/msgProcess/findJob", methods=["GET"])
@app.route("/msgProcess/findJob", methods=["POST"])
def findJob():
original_text = request.form.get("text", None)
if not original_text:
Expand All @@ -17,7 +17,7 @@ def findJob():
return jsonify(job_info)


@app.route("/msgProcess/recruit", methods=["GET"])
@app.route("/msgProcess/recruit", methods=["POST"])
def recruit():
original_text = request.form.get("text", None)
if not original_text:
Expand Down

0 comments on commit 5b32a75

Please sign in to comment.