How to convert a captcha image to base64 string?


I am using http request ( to get an image.
See the comments below:

http.request({ url: "", method: "GET" }).then(function (response) {   
    var img = response.content.toImage();  // I find this returns a promise
       // I find image has a method "toBase64String"
       // But do not know how to use it, I find no document for this.
}, function (e) {


Is this a question, or a tip? If it’s the former, what is the question? If you found that the image has a method toBase64String - have you tried to call it?


It is a question, as the title says.
I tried to call it. But the result is null.


Did you try . toBase64String("png")? The format param is required.


Solved. Thank you for your link.
The document should contain this.