Gwan C # how to get HTTP headers?

I need this to rewrite the url to find out which friendly url i am processing. For User-Agent and other things.


public class Gwan
    extern public static long getEnv(string arg, int name);

Gwan.xbufCat(Gwan.getReply(args[0]), Gwan.getEnv(args[0], 3).ToString());


Unhandled Exception: System.MissingMethodException: The requested method cannot be found. at (wrapper managed for native) Gwan: getEnv (String, integer)

What am I doing wrong?

I guess at your end you need to put something like:

mono_add_internal_call ("Gwan::getEnv", get_env);


Dll in / cs folder where gwan_api is not loaded either


source to share

2 answers

As with Java, G-WAN has created some wrappers for the G-WAN C API. In both cases (Java and C #), these wrappers can be found in the directory gwan/libraries/cs


Currently the C # wrappers are:

// gwan_api.cs: exported G-WAN API calls for .NET C# servlets
using System;
using System.Runtime.CompilerServices;

public class Gwan
    extern public static long getReply(string env);

    extern public static void xbufCat(long reply, string mono_reply);

   extern public static long cycles64();

   extern public static long getNs   ();

   extern public static long getUs   ();

   extern public static long getMs   ();

   extern public static void logErr  (long env, String msg);

   extern public static void report  (long reply, int html_format);


But you are free to redistribute this file by adding more wrappers for either the G-WAN C API or third party C libraries loaded by your G-WAN scripts.

Hope it helps.


You should implement C # wrappers for any new G-WAN API (or external function) that you want to support from your C # scripts.

The included file above is a simple list (not an implementation).

See the Mono documentation for more information - or send us a string on the G-WAN if you'd like to sponsor the features you need.



I think you will have to search your site for support information or experiment with the code to display headers, try to display them in (headersvariable); to start

REQUEST_LEN, // int REQUEST_LEN // strlen(REQUEST); with headers 
HTTP_HEADERS, // struct *http_t; // see struct http_t above
HEAD_XBUF, // xbuf_t*HEAD_XBUF; // response HTTP headers(), if any 




All Articles