カール --data-urlencode と下線

カール --data-urlencode と下線

私はPerl関数で生成された(実際のサンプル)形式curl -XPOSTのURLを使用して、ボットAPI /キーを介してTelegramチャネルへのいくつかのリンクを公開しました。https://site/x/pre_encoded_stringpre_encoded_stringXOsmY90GWWA4QHTV_K_WwQMIME::Base64 encode_base64url

結果文字列にアンダースコア文字が含まれている場合_(上記の2番目の例のように)、これは失敗し、アンダースコア文字が削除され、公開が次のようにcurl表示されます。4QHTVKWwQ

--data-*(binary、raw、urlencode)を削除し、URLに文字列を渡しても削除されます。

ais@rex ~ # curl -vv -s -XPOST 'https://api.telegram.org/bot1[...]4:AAE[...]Ggd3g/sendMessage?parse_mode=Markdown&chat_id=@xt2RM' --data-urlencode 'text=https://xt2/x/4QHTV_K_WwQ'
*   Trying 149.154.167.198...
* Connected to api.telegram.org (149.154.167.198) port 443 (#0)
* Initializing NSS with certpath: none
*   CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none
* NPN, server accepted to use http/1.1
* SSL connection using TLS_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=api.telegram.org,OU=Domain Control Validated
*       start date: May 23 16:17:38 2015 GMT
*       expire date: May 23 16:17:38 2018 GMT
*       common name: api.telegram.org
*       issuer: CN=Go Daddy Secure Certificate Authority - G2,OU=http://certs.godaddy.com/repository/,O="GoDaddy.com, Inc.",L=Scottsdale,ST=Arizona,C=US
> POST /bot1[...]4:A[...]ApJyf9Pg0/sendMessage?parse_mode=Markdown&chat_id=@xt2RM HTTP/1.1
> Host: api.telegram.org
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 55
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 55 out of 55 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.9.1
< Date: Mon, 28 Dec 2015 18:55:30 GMT
< Content-Type: application/json
< Content-Length: 193
< Connection: keep-alive
< Strict-Transport-Security: max-age=31536000; includeSubdomains
< 
* Connection #0 to host api.telegram.org left intact
{"ok":true,"result":{"message_id":1506,"chat":{"id":-1[........]8,"title":"tty2RM","username":"tty2RM","type":"channel"},"date":1451328930,"text":"https:\/\/xt2\/x\/4QHTVKWwQ"}}
ais@rex ~ #

私の問題が何であるかについての手がかりはありますか?

ベストアンサー1

おすすめ記事