You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to take advantage of your code in a uPy program to push an image to pushbullet and have been trying to understand your code in order to adapt it for my purposes. I tried calling the uploader.py "make_request" function with the output from my first call to pushbullet which obtains the url used to upload among other things. Here's my output from that call:
respd = json.loads(resp.text)
for key, value in respd.items():
print(key, ' : ', value)
data, headers = make_request(data=respd, image='jetfire40.jpg')
<<<<<<<<<<<<<<<<<<<<<<<<<<
I get an error:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
TypeError: join expects a list of str/bytes objects consistent with self object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
But, I'm sure it's because I don't understand the semantics of your code. Can you help? I'm using urequests and therefore have to pass it a multipart/form-data as I understand it because urequests doesn't support the "files" parameter that requests does.
Thanks for any help you can provide. FWIW, pushbullet's api doc is fairly useless in figuring things out.
The text was updated successfully, but these errors were encountered:
I'm trying to take advantage of your code in a uPy program to push an image to pushbullet and have been trying to understand your code in order to adapt it for my purposes. I tried calling the uploader.py "make_request" function with the output from my first call to pushbullet which obtains the url used to upload among other things. Here's my output from that call:
upload_url : https://upload.pushbullet.com/upload-legacy/EJz498Ega15yxUIPviAP7J6JlttKEbXb
data : {'key': 'Z6bJNYKElcJeappWL52cNGXutU1U1aYO/jetfire40.jpg', 'awsaccesskeyid': 'AKIAJJIUQPUDGPM4GD3W', 'acl': 'public-read', 'policy': 'eyKjb25kaXRpb25zIjTE6MzcuMjM0MTMwWiJ9', 'signature': 'UX5s1uIy1ov6+xlj58JY7rGFKcs=', 'content-type': 'image/jpeg'}
file_url : https://dl3.pushbulletusercontent.com/Z6bJNYKElcJeappWL52cNGXutU1U1aYO/jetfire40.jpg
file_type : image/jpeg
file_name : jetfire40.jpg
When I call the make_request function thusly:
respd = json.loads(resp.text)
for key, value in respd.items():
print(key, ' : ', value)
data, headers = make_request(data=respd, image='jetfire40.jpg')
<<<<<<<<<<<<<<<<<<<<<<<<<<
I get an error:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
TypeError: join expects a list of str/bytes objects consistent with self object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
But, I'm sure it's because I don't understand the semantics of your code. Can you help? I'm using urequests and therefore have to pass it a multipart/form-data as I understand it because urequests doesn't support the "files" parameter that requests does.
Thanks for any help you can provide. FWIW, pushbullet's api doc is fairly useless in figuring things out.
The text was updated successfully, but these errors were encountered: