soup-method

soup-method — HTTP method definitions

Synopsis

#define             SOUP_METHOD_OPTIONS
#define             SOUP_METHOD_GET
#define             SOUP_METHOD_HEAD
#define             SOUP_METHOD_PUT
#define             SOUP_METHOD_POST
#define             SOUP_METHOD_DELETE
#define             SOUP_METHOD_TRACE
#define             SOUP_METHOD_CONNECT

#define             SOUP_METHOD_PROPFIND
#define             SOUP_METHOD_PROPPATCH
#define             SOUP_METHOD_MKCOL
#define             SOUP_METHOD_COPY
#define             SOUP_METHOD_MOVE
#define             SOUP_METHOD_LOCK
#define             SOUP_METHOD_UNLOCK

Description

soup-method.h contains a number of defines for standard HTTP and WebDAV headers. You do not need to use these defines; you can pass arbitrary strings to soup_message_new() if you prefer.

The thing that these defines are useful for is performing quick comparisons against SoupMessage's method field; because that field always contains an interned string, and these macros return interned strings, you can compare method directly against these macros rather than needing to use strcmp(). This is most useful in SoupServer handlers. Eg:

	if (msg->method != SOUP_METHOD_GET && msg->method != SOUP_METHOD_HEAD) {
		soup_message_set_status (msg, SOUP_METHOD_NOT_IMPLEMENTED);
		return;
	}

Details

SOUP_METHOD_OPTIONS

#define SOUP_METHOD_OPTIONS   (_SOUP_METHOD_OPTIONS ? _SOUP_METHOD_OPTIONS : (_SOUP_METHOD_OPTIONS = g_intern_static_string ("OPTIONS")))

"OPTIONS" as an interned string.


SOUP_METHOD_GET

#define SOUP_METHOD_GET       (_SOUP_METHOD_GET ? _SOUP_METHOD_GET : (_SOUP_METHOD_GET = g_intern_static_string ("GET")))

"GET" as an interned string.


SOUP_METHOD_HEAD

#define SOUP_METHOD_HEAD      (_SOUP_METHOD_HEAD ? _SOUP_METHOD_HEAD : (_SOUP_METHOD_HEAD = g_intern_static_string ("HEAD")))

"HEAD" as an interned string.


SOUP_METHOD_PUT

#define SOUP_METHOD_PUT       (_SOUP_METHOD_PUT ? _SOUP_METHOD_PUT : (_SOUP_METHOD_PUT = g_intern_static_string ("PUT")))

"PUT" as an interned string.


SOUP_METHOD_POST

#define SOUP_METHOD_POST      (_SOUP_METHOD_POST ? _SOUP_METHOD_POST : (_SOUP_METHOD_POST = g_intern_static_string ("POST")))

"POST" as an interned string.


SOUP_METHOD_DELETE

#define SOUP_METHOD_DELETE    (_SOUP_METHOD_DELETE ? _SOUP_METHOD_DELETE : (_SOUP_METHOD_DELETE = g_intern_static_string ("DELETE")))

"DELETE" as an interned string.


SOUP_METHOD_TRACE

#define SOUP_METHOD_TRACE     (_SOUP_METHOD_TRACE ? _SOUP_METHOD_TRACE : (_SOUP_METHOD_TRACE = g_intern_static_string ("TRACE")))

"TRACE" as an interned string.


SOUP_METHOD_CONNECT

#define SOUP_METHOD_CONNECT   (_SOUP_METHOD_CONNECT ? _SOUP_METHOD_CONNECT : (_SOUP_METHOD_CONNECT = g_intern_static_string ("CONNECT")))

"CONNECT" as an interned string.


SOUP_METHOD_PROPFIND

#define SOUP_METHOD_PROPFIND  (_SOUP_METHOD_PROPFIND ? _SOUP_METHOD_PROPFIND : (_SOUP_METHOD_PROPFIND = g_intern_static_string ("PROPFIND")))

"PROPFIND" as an interned string.


SOUP_METHOD_PROPPATCH

#define SOUP_METHOD_PROPPATCH (_SOUP_METHOD_PROPPATCH ? _SOUP_METHOD_PROPPATCH : (_SOUP_METHOD_PROPPATCH = g_intern_static_string ("PROPPATCH")))

"PROPPATCH" as an interned string.


SOUP_METHOD_MKCOL

#define SOUP_METHOD_MKCOL     (_SOUP_METHOD_MKCOL ? _SOUP_METHOD_MKCOL : (_SOUP_METHOD_MKCOL = g_intern_static_string ("MKCOL")))

"MKCOL" as an interned string.


SOUP_METHOD_COPY

#define SOUP_METHOD_COPY      (_SOUP_METHOD_COPY ? _SOUP_METHOD_COPY : (_SOUP_METHOD_COPY = g_intern_static_string ("COPY")))

"COPY" as an interned string.


SOUP_METHOD_MOVE

#define SOUP_METHOD_MOVE      (_SOUP_METHOD_MOVE ? _SOUP_METHOD_MOVE : (_SOUP_METHOD_MOVE = g_intern_static_string ("MOVE")))

"MOVE" as an interned string.


SOUP_METHOD_LOCK

#define SOUP_METHOD_LOCK      (_SOUP_METHOD_LOCK ? _SOUP_METHOD_LOCK : (_SOUP_METHOD_LOCK = g_intern_static_string ("LOCK")))

"LOCK" as an interned string.


SOUP_METHOD_UNLOCK

#define SOUP_METHOD_UNLOCK    (_SOUP_METHOD_UNLOCK ? _SOUP_METHOD_UNLOCK : (_SOUP_METHOD_UNLOCK = g_intern_static_string ("UNLOCK")))

"UNLOCK" as an interned string.