I am new to Kodular and I love it! But I have a problem. When I call my API it returns 400 error on wrong input and information on what went wrong (I want to get 400 when something is wrong). I send a request to my API using Web component, but when web1.GotFile is called, file in which info should be saved does not exists.
How could i get content of web response?
Thank you for your hep!
if you use the GotFile event, then you will find the response in the downloaded file
Taifun Yes, I tried. I have it.
But it doesn’t work if response is anything other that 200.
Yes. FileName returns a file that does not exist. I checked through filesystem and using File1.Exists…
responseCode is 400 as I want it to be…
Do you want it to be code 400?
Yes. I want it to be 400. It should be. Because user has sent wrong text.
to debug this you might want to display the filename in a label, let us know, what you find out…
probably the path should be modified so the file component will then be able to read it?
Web1.GotFile fileName returns: " /storage/emulated/0/My Documents/Downloads/app_inventor_1605564580403.html"
And file does not exists on my phone…
But if Web1.GotFile responseCode is 200 (returns wav recording), then the filename is: “/storage/emulated/0/My Documents/Downloads/app_inventor_1605565177181.tmp”.
are you sure? how did you check this?
to read that file using the file component you will have to remove the
/storage/emulated/0 to get a relative path for the file component…
this filename should work for the file component:
EDIT: but as it is a html document probably better to use a webviewer to display it… in this case use the full path…
Taifun it works now!!
I didn’t know that File1.Read can’t handle
/storage/emulated/0 absolute path.
I have learnt something new today…
How You Solved ?
It is important to show to help others. And mark your solution.
this is the solution
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.