bleer

欢迎你来到我的空间哦~

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

flask简单介绍

 

flask使用

 

 

踩的坑

1.从postman发请求是ok的,但是从命令发curl 命令请求失败,为什么?

---原因:postman对参数进行了编码,空格会urlencode编码成%20,curl的时候空格没有编码,所以会失败。

话说:urlencode是编码的目的是什么?---因为在web服务器中,接收的参数是不允许出现空格的。所以urlencode能够实现把空格和其他特殊字符进行编码,便于web服务器接收。

 2.请求返回internal error

报错信息如下:

dp-8f54d9e725-5b5b9dcc59-46qzc(boe.liurong_demo.httpserver_demo@default:boe_feature1):mysql# curl --location --request POST 'http://127.0.0.1:8220/ReadDBByPsm?db_psm=toutiao.mysql.liurong1018_read&sql_cmd=show%20databases;'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>

 

 

 

参考

 

posted on 2021-11-02 14:10  bleer  阅读(61)  评论(0编辑  收藏  举报