Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions request.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:: you can use this like so from cmd or pwsh:
:: request.bat <filename>
@echo off
curl --header 'Additional: Header' --form additional=image --form image=@%1 https://u.aql.ink/new_image
19 changes: 19 additions & 0 deletions request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,27 @@

import requests


# post to the url shortener
url = "http://localhost:8192/new"
payload = "http://some.long.domain.tld/directory/structure"

r = requests.post(url, data=payload)
print(r.text)

# and to the image hosting service - this doesn't work for some reason :(

url = "http://localhost:8192/new_image"
headers = {
'Additional': 'Header',
}
files = {
'additional': 'image',
'image': open('random-pictures-MR0G79.jpg', 'rb'),
}
#payload = open(sys.argv[1], "rb")

#print(files)

r = requests.post(url, headers=headers, files=files)
print(r.text)
5 changes: 3 additions & 2 deletions request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
curl -v -d "https://some.long.tld/subdirectory/here" -X POST http://localhost:8193/new
# testing image rehosting
curl --header 'Additional: Header' --form additional=image --form image=@random-pictures-MR0G79.jpg http://localhost:8193/new_image
# get one of your uploading images
http://localhost:8193/i/<unique_name>
#curl --header 'Additional: Header' --form additional=image --form image=@random-pictures-MR0G79.jpg https://u.aql.ink/new_image
# get one of your uploaded images
#http://localhost:8193/i/<unique_name>