-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal PNetwork.httpPost method not found #89
Comments
Hi @Slord6, Which version of PHONK are you using? Can you check if that solves the problem? |
Hey, I've just done a fresh install from the play store to ensure I have the most up-to-date version but the 'About' section in the app's settings lists the version as Also, as an aside, post re-install the app got into a bit of a weird state where it would crash trying to update the example scripts and couldn't create projects, but I solved that by clearing the app data (My scripts ended up reappearing too). I only mention this in case someone else has the same issue and searches the issue tracker. |
Oh! totally my bad. I forgot to upload 1.3.1 to the playstore 😅 Im uploading it as we speak (its in review now) Btw, I just released 1.3.2 which you can find it here https://github.com/victordiaz/PHONK/releases/tag/1.3.2 Regarding the re-install. I had that too sometimes but I could not figure out the reason :/ |
Thanks @victordiaz, got the update (1.3.1) installed and am now seeing the updated example script with the new method call. However, if I create a new project and copy/paste the example http post code, I get an Full code, for clarity (but it's exactly the same as the example from what I can tell, and that runs fine): /*
* PHONK Example: HTTP_POST
*
* With this code you are able to upload multipart content to a webserver
* An example of a php file that will handle the upload is included
*
* The type of each data part can be text / json / file
* If type === file then it will automatically load from the folder
* and transfer
*
*/
ui.addTitle(app.name)
network.httpRequest({
method: 'POST',
url: 'https://postman-echo.com/post',
data: [
{ 'name': 'field_1', 'content': 'hello', 'type': 'text' },
{ 'name': 'field_2', 'content': 'world', 'type': 'text' },
{ 'name': 'userfile', 'content': 'patata.png', 'type': 'file', 'mediaType': 'image/png' }
]
}).onResponse(function (e) {
console.log(e.status, e.response)
}) |
Hi @Slord6 Try to remove the following line and let me know if it works I'll try to catch the exception and give better feedback on the console |
Ah, yes - of course! Thanks! |
I'm crrating a new issue with the feedback you gave me :) |
Problem
Calls to network.httpPost fail with console error:
The Method 'io.phonk.runner.apprunner.api.PNetwork.httpPost(string,object,function)' is not found
Device model
Blackberry KeyOne
Android version
8.1.0
Steps to reproduce the bug
Run the
examples/Network/HTTP POST
example scriptThe text was updated successfully, but these errors were encountered: