I have to submit geojsons from a Postgres (PostGIS) database with requests.post() method and the files argument:
x = requests.post(url, files = myfiles)
However, I need to avoid writing all my geojsons to a file and then read them again (the cloud environment where the PostsGres is running does not allow me to store files).
I read that a workaround could be to populate the file parameter with a tuple (https://stackoverflow.com/a/23131823/16214039). However, I cannot manage to store my geojson strings into a tuple, since the string will be sliced/splitted due to the '' and comma's in the geojson string when I try to convert it to a tuple element. Any ideas how I can solve this?
"""around the literal if you want to secure all regular single'and double quotes"inside the string. If that's not what you had in mind, please attach an example where the string in your tuple gets split against your intention.