mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-09 22:57:33 +02:00
improved website examples to show attachments using curl
This commit is contained in:
@ -115,6 +115,12 @@
|
|||||||
-F attach1=@Screenshot-1.png \<br/>
|
-F attach1=@Screenshot-1.png \<br/>
|
||||||
-F attach2=@/my/path/to/Apprise.doc \<br/>
|
-F attach2=@/my/path/to/Apprise.doc \<br/>
|
||||||
http{% if request.is_secure %}s{% endif %}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em></code></pre>
|
http{% if request.is_secure %}s{% endif %}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em></code></pre>
|
||||||
|
{% blocktrans %}Sends a notification to our endpoints with an attachment{% endblocktrans %}
|
||||||
|
<pre><code class="bash">
|
||||||
|
curl -X POST \<br/>
|
||||||
|
-F "tag=all" \ <br/>
|
||||||
|
-F "attach=https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png" \ <br/>
|
||||||
|
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em>"</code></pre>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
|
@ -99,6 +99,11 @@
|
|||||||
-F attach2=@Screenshot-2.png \ <br/>
|
-F attach2=@Screenshot-2.png \ <br/>
|
||||||
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/"
|
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/"
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<pre><code class="bash">
|
||||||
|
# {% blocktrans %}Send an web based file attachment to a <a href="https://github.com/caronc/apprise/wiki/Notify_discord" target="_blank">Discord</a> server:{% endblocktrans %}<br/>
|
||||||
|
curl -X POST -F 'urls=discord://credentials' \<br/>
|
||||||
|
-F "attach=https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png" \ <br/>
|
||||||
|
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/"</code></pre>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -492,6 +497,12 @@
|
|||||||
-F "tag=all" \ <br/>
|
-F "tag=all" \ <br/>
|
||||||
-F "body=test body" \ <br/>
|
-F "body=test body" \ <br/>
|
||||||
-F "title=test title" \ <br/>
|
-F "title=test title" \ <br/>
|
||||||
|
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em>"</code></pre>
|
||||||
|
<pre><code class="bash">
|
||||||
|
# {% blocktrans %}Sends a notification to our endpoints with an attachment{% endblocktrans %}<br/>
|
||||||
|
curl -X POST \<br/>
|
||||||
|
-F "tag=all" \ <br/>
|
||||||
|
-F "attach=https://raw.githubusercontent.com/caronc/apprise/master/apprise/assets/themes/default/apprise-logo.png" \ <br/>
|
||||||
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em>"</code></pre>
|
"{{request.scheme}}://{{request.META.HTTP_HOST}}{{BASE_URL}}/notify/<em>{{key}}</em>"</code></pre>
|
||||||
<pre><code class="bash">
|
<pre><code class="bash">
|
||||||
# {% blocktrans %}Notifies all URLs assigned the <em>devops</em> tag{% endblocktrans %}<br/>
|
# {% blocktrans %}Notifies all URLs assigned the <em>devops</em> tag{% endblocktrans %}<br/>
|
||||||
|
@ -1043,11 +1043,9 @@ class NotifyTests(SimpleTestCase):
|
|||||||
|
|
||||||
json_data = {
|
json_data = {
|
||||||
'body': 'test message',
|
'body': 'test message',
|
||||||
'format': None,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Same results for any empty string:
|
# Same results for any empty string:
|
||||||
json_data['format'] = ''
|
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
'/notify/{}'.format(key),
|
'/notify/{}'.format(key),
|
||||||
data=json.dumps(json_data),
|
data=json.dumps(json_data),
|
||||||
|
@ -293,7 +293,6 @@ class StatelessNotifyTests(SimpleTestCase):
|
|||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
assert mock_notify.call_count == 0
|
assert mock_notify.call_count == 0
|
||||||
|
|
||||||
|
|
||||||
@override_settings(APPRISE_RECURSION_MAX=1)
|
@override_settings(APPRISE_RECURSION_MAX=1)
|
||||||
@mock.patch('apprise.Apprise.notify')
|
@mock.patch('apprise.Apprise.notify')
|
||||||
def test_stateless_notify_recursion(self, mock_notify):
|
def test_stateless_notify_recursion(self, mock_notify):
|
||||||
|
Reference in New Issue
Block a user