UrlRequest sending images

35 views
Skip to first unread message

ivan limonov

unread,
Jun 28, 2015, 7:39:55 PM6/28/15
to kivy-...@googlegroups.com
Hello.
I use the camera to take pictures, and I need to send the image and the description to the server.
I'm trying to do this with UrlRequest but I can not do it.
Help me small example of use UrlRequest to send the image.

Ivlev Denis

unread,
Jul 1, 2015, 4:51:26 AM7/1/15
to kivy-...@googlegroups.com
Simple snapshot sender in my project.
If you send files to html forms, use standart http request body and header, nice exaplles with urllib*.

ivan limonov

unread,
Jul 1, 2015, 7:19:06 AM7/1/15
to kivy-...@googlegroups.com
I do not think of anything better than to use the base64 encoding, but this increases the size of the data 2 times that bad, if you use another library to work with queries, you will need to make requests in the new thread that would not block the current thread.
A UrlRequest already take care of that, but it seems you can not send it through the files on the line without resorting to base64, 'cause no one until I could not answer my question.
--------------------------------------------------------------
Я тоже не придумал ничего лучше чем использовать base64 кодирование, но это увеличивает размер данных раза в 2, что плохо, если использовать другую библиотеку для работы с запросами, то нужно будет самому делать запросы в новом потоке что бы не заблокировать текущий поток.
А UrlRequest уже заботиться об этом, но похоже через него нельзя отправлять файлы на прямую не прибегая к base64, потому что никто пока мне так и не смог ответить на мой вопрос
.
среда, 1 июля 2015 г., 12:51:26 UTC+4 пользователь Ivlev Denis написал:
Reply all
Reply to author
Forward
0 new messages