TelegramBots icon indicating copy to clipboard operation
TelegramBots copied to clipboard

Provide a setting for using java.net.HttpURLConnection instead of HTTPClient

Open DrakkosSF opened this issue 6 years ago • 4 comments

The library cannot be used on Google App Engine because it uses Apache HTTP Client under the hood to manage communications with Telegram servers.

If it had a setting to use java.net.HttpURLConnection instead, it could run fine in Google App Engine java 8 environments with urlfetch configured in appengine-web.xml as noted here.

DrakkosSF avatar Apr 26 '18 16:04 DrakkosSF

Hi, you could use Telegram-meta package and implement you own version of the bot that doesn't use Apache client, it should make the trick.

rubenlagus avatar Apr 29 '18 11:04 rubenlagus

Thanks for the directions. Started looking into DefaultAbsSender and seemed like only necessary rework needed was implementing a bridge that would post Http Client's HTTPPost parameters with java.net.HttpUrlConnection. Will take a look at telegram-meta probably a cleanest place to insert custom behaviour like this.

DrakkosSF avatar Apr 29 '18 11:04 DrakkosSF

@DrakkosSF I'm open to consider a pull request with those changes if they are valid and useful for everyone

rubenlagus avatar May 26 '18 10:05 rubenlagus

If this hasn't been done, I would like to pick this up. Let me know if this is still available.

bhati3 avatar Oct 23 '21 22:10 bhati3