[AC-1172] Android HTTPClient: POST with image encoded as base64 sent as GET
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2016-01-07T08:24:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, defect, httpclient |
Reporter | Ryan Asleson |
Assignee | Sharif AbuDarda |
Created | 2015-12-25T21:18:01.000+0000 |
Updated | 2016-03-08T07:37:32.000+0000 |
Description
Attachments
File | Date | Size |
---|---|---|
IMAG0443.jpg | 2015-12-25T20:59:56.000+0000 | 1886092 |
post-as-base64.txt | 2015-12-25T21:05:13.000+0000 | 2647930 |
post-as-binary.txt | 2015-12-25T21:01:58.000+0000 | 3228034 |
post-with-both.txt | 2015-12-30T22:38:50.000+0000 | 5742965 |
What happens when you keep both of them?
Or try to make a blob of the image and then try base64encode.
Reply with your response. Thanks.
First, I noticed that the
encodedImage
key on thedata
object wasn't in quotes like the others, so I changed it. Doesn't seem to have made a difference. Anyway, when I sent the image as both binary data and as base64 like this:The data was correctly sent as a
POST
. See attachment post-as-both.txt. When I tried your suggestion of converting to a blob like this:I get a runtime error that says this: Message: Uncaught TypeError: Object [object TiBlob] has no method 'toBlob' Source: encodedImage: TiUtils.base64encode(selectedImage.toBlob()).toStri Apparently
selectedImage
is already a Blob. Does that help?Hello, It looks like when you tried to sent the image as both binary data and as base64, The data was correctly sent as a POST. Which I think resolves your issue. We will resolve this issue. If you have any further requirement please let us know. Thanks.
Hi, it's definitely *NOT* working correctly. The problem is that when sending the image as base64 (and only base64), the data is sent as a GET instead of a POST. See attachment post-as-base64.txt. My apologies, but I should have mentioned earlier that I do explicitly set the request to be a POST:
Yes, when I sent the image as both binary and base64 the request was correctly sent as a POST. The issue is that when the image is sent *only* as base64, it's sent as a GET. Let me know what you find. Thank you!!!