HTTP Status 415 – Unsupported Media Type

2019-08-27 10:48发布

I'm referring to the question in link

Based from solution, I manage to solve it by removing sending the 2 dimension array for MethodStatus. However, after integrate with the other component, it require me to have the 2 dimension array.

Rest Call Code:

public int adaptiveAuth( @FormDataParam("uuid") String uuID, 
        @FormDataParam("browserinfo") String browserInfo, 
        @FormDataParam("ipint") long ipInt, 
        @FormDataParam("lat") double latiTude, 
        @FormDataParam("longitude") double longiTude, 
        @FormDataParam("sessionid") String sessionID, 
        @FormDataParam("spid") String spID, 
        @FormDataParam("tr") int tR, 
        @FormDataParam("jsnum") int jsNum, 
        @FormDataParam("fingerprint") String fingerPrint ,
        @FormDataParam("methodset") MethodClass[][] methodSet) throws SQLException{ 

    int returnValue = AdaptiveAuthService.adaptiveAuth(uuID, browserInfo, ipInt, 
            latiTude, longiTude, sessionID, spID, tR, jsNum, fingerPrint, methodSet);

AdaptiveAuth Code:

    public static int adaptiveAuth(String uuID, String browserInfo, long ipInt, double latiTude, double longiTude,
        String sessionID, String spID, int tR, int jsNum, String fingerPrint, MethodClass[][] methodSet)
        throws SQLException {


int aAC = methodSet[0].length;
        int authMethod = methodSet[0][aAC - 1].getmethodName();
        int authStatus = methodSet[0][aAC - 1].getmethodStatus();

Method Class Code:

public class MethodClass {
    private int methodName;
    private int methodStatus;

    public MethodClass() {
        methodName = 0;
        methodStatus = 0;
    }

    public int getmethodName() {
        return methodName;
    }

}

My question:

1-Is MediaType - TEXT_PLAIN is correct? If it is correct, may I know which part at my code is wrong? If it is not correct, what MediaType should I need to use?

0条回答
登录 后发表回答