擅长:python、mysql、java
<p>使用<code>format()</code>构建该url。另外,了解如何使用<code>format()</code>使用命名占位符,下面提供的示例将使用这些占位符</p>
<pre><code>s = s.replace('\n', '%0A') # Replaces \n with urlencoded \n (%0A)
url = 'https://maker.ifttt.com/trigger/Custom Newsfeed/with/key/nYmoaoROeu6Mf2SrBOgUg?value1={value1}'.format(value1=s)
r = requests.post(url)
</code></pre>
<p>也可以使用urlencode</p>
<pre><code>>>> import urllib
>>> f = { 'value1' : s}
>>> urllib.urlencode(f)
'value1=cool+event'
</code></pre>