Android Question okHTTP replaced with HTTP issues are coming.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,
My app was connecting fine suddenly i started getting msg "HTTP Error 403.0 - ModSecurity Action You do not have permission to access this file or folder" as such i replaced HTTP with okHTTP. But app is still not connecting.Pls help.

Juzer
 
You don't mention what it is that you are connecting too? Is it possible that something has changed on that side?
I've had this problem before on some Windows pc's when trying to access file shares. It turned out to be the file sharing permissions.
 
Upvote 0
Hi Erel,
I tried typing "www.website.com/pagename.aspx?Query=!Select * from companymaster! and it reproduced the issue saying "
HTTP Error 406.0 - ModSecurity Action
The resource cannot be displayed because the file extension is not being accepted by your browser.

This indeed look like security issue.
I will appreciate if you could point me to some example of "using setting user agent"

Thanks
Juzer
 
Upvote 0
continued...

and below it says
Most Likely cause
"The request was rejected because it contained an Accept header for a MIME type that is not supported for the requested file extension."
Try
"Verify the MIME settings for the file extension that was requested to make sure this MIME type is acceptable."

Juzer
 
Upvote 0
use this right after your job.download call

Code:
dljob.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0")

altho I doubt that would solve that issue. Does that page work when copying it in a browser's address bar?
 
Upvote 0
Hi Sorex,
No it doesn't work from browser.It says the error HTTP Error 406.0 - ModSecurity Action as i said above.
I tried using above string after job1.download2 it says
"(Intent) Intent { cmp=b4a.example/anywheresoftware.b4a.samples.httputils2.httputils2service }"
"<title>IIS 7.5 Detailed Error - 406.0 - ModSecurity Action</title> "

I have no clue what to do?

Juzer
 
Upvote 0
how do you return the data?

you should just "print" the data, don't mess around with none standard mime type outputs. that's the problem it seems.
 
Upvote 0
It returns a Json string
Response.Write(j.Serialize(list.ToArray()));
With the same aspx file i was connected regularly earlier without any problems.
 
Upvote 0
well, it doesn't work when I copy the url in my desktop browser either.

it gives a 403 error, when I modify it a little it passes that but then it gives a 406 error and nags about unknown mimetypes.
 
Upvote 0
Back
Top