简体   繁体   中英

How to get POST request to work with GWAN using JAVA servlets

I'm experimenting with java servlets using GWAN. It's easy to get GET requests to work using the api.Gwan class.

My problem is how do I get POST requests to work.

import api.Gwan;

public class ProccessGETRequest {
    public static int jmain(long env, String[] args) {
    //GET request  is contained in the args
    ...
    //but how do you access the POST request?
    }
} 

If this functionality does not exist, could someone suggest an implementation. This would be easier to figure out if the api.Gwan class were open source... :(

In C servlets both post and get args is in "args". I haven't tried java in G-WAN but i think the post args should be on the same location.

Richard is right: G-WAN does the parsing for you so jmain(args) contain the arguments of both GET and POST requests.

There's nothing special to do on your end, see the loan.java example which can be used in both modes, GET and POST.

For some languages the G-WAN API is sometimes ported partially (like for C# or Java) because it makes little sense to use G-WAN xbuffers which are playing with UTF8 on platforms that use UTF16 characters and abstracted strings (they require a data copy anyway to talk to G-WAN).

The same goes with high-performance routines which would lost their purpose (speed) if they were encapsulated in language wrappers.

But if you are missing something specific then the G-WAN developers are open to adding features, as I have seen in the past. Just drop them a line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM