Server returned HTTP response code: 500 for REST API call
-
Trying to block the IP using FauxAPI.
I'm trying to access the function_call API by making the HTTP request using JAVA code as follows,
phpFn = 'easyrule_block_alias_getid' and fnParams='wan'
HttpURLConnection con = (HttpURLConnection)url.openConnection(); con.setRequestProperty("fauxapi-auth", getAuth()); con.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"); con.setRequestProperty("Accept-Encoding", "gzip, deflate, br"); con.setRequestProperty("Accept-Language", "en-US,en;q=0.9,hi;q=0.8"); con.setRequestProperty("Cache-Control", "max-age=0"); con.setRequestProperty("Connection", "keep-alive"); con.setRequestProperty("Upgrade-Insecure-Requests", "11"); con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"); con.setRequestProperty("Origin", ""); con.setAllowUserInteraction(true); con.setRequestMethod("POST"); con.setDoInput(true); con.setDoOutput(true); OutputStream os = con.getOutputStream(); BufferedWriter writer = new BufferedWriter( new OutputStreamWriter(os, "UTF-8")); writer.write("{\"function\":\""+phpFn+"\",\"int\":\""+fnParams[0]+"\"}"); writer.flush(); writer.close(); os.close(); con.connect();
same code works for the
get_services
function of the function_call API.
-
Trying to block the IP using FauxAPI.
Your best bet is to talk to the author of it, as this isn't an official package.