ash*_*aka 18 post webserver encoding curl http
我想在终端提示符下POST
使用(发送)一些表单数据到网络服务器cURL
.
这是我到目前为止所得到的:
curl --data-ascii "content=derinhält&date=asdf" http://myserverurl.com/api/v1/somemethod
Run Code Online (Sandbox Code Playgroud)
问题是变形金刚("äöü")被"?"取代 当我在服务器上收到邮件请求时.
我想我需要为POST
请求使用UTF-8编码.
有谁知道我怎么能做到这一点?
Kir*_*nov 29
您可以在POST请求中使用UTF-8,您只需在请求中指定字符集即可.
您应该使用此请求:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" --data-ascii "content=derinhält&date=asdf" http://myserverurl.com/api/v1/somemethod
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
77597 次 |
最近记录: |