00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef AXIS2_HTTP_SIMPLE_RESPONSE_H
00019 #define AXIS2_HTTP_SIMPLE_RESPONSE_H
00020
00032 #include <axis2_const.h>
00033 #include <axis2_defines.h>
00034 #include <axutil_env.h>
00035 #include <axutil_array_list.h>
00036 #include <axis2_http_status_line.h>
00037 #include <axis2_http_header.h>
00038 #include <axutil_stream.h>
00039
00040
00041 #ifdef __cplusplus
00042 extern "C"
00043 {
00044 #endif
00045
00047 typedef struct axis2_http_simple_response axis2_http_simple_response_t;
00048
00057 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00058 axis2_http_simple_response_set_status_line(struct axis2_http_simple_response *simple_response,
00059 const axutil_env_t *env,
00060 const axis2_char_t *http_ver,
00061 const int status_code,
00062 const axis2_char_t *phrase);
00063
00068 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00069 axis2_http_simple_response_get_phrase(axis2_http_simple_response_t *simple_response,
00070 const axutil_env_t *env);
00071
00076 AXIS2_EXTERN int AXIS2_CALL
00077 axis2_http_simple_response_get_status_code(axis2_http_simple_response_t *simple_response,
00078 const axutil_env_t *env);
00079
00084 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00085 axis2_http_simple_response_get_http_version(axis2_http_simple_response_t *simple_response,
00086 const axutil_env_t *env);
00087
00092 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00093 axis2_http_simple_response_get_status_line(axis2_http_simple_response_t *simple_response,
00094 const axutil_env_t *env);
00095
00101 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00102 axis2_http_simple_response_contains_header(axis2_http_simple_response_t *simple_response,
00103 const axutil_env_t *env,
00104 const axis2_char_t *name);
00105
00110 AXIS2_EXTERN axutil_array_list_t* AXIS2_CALL
00111 axis2_http_simple_response_get_headers(axis2_http_simple_response_t *simple_response,
00112 const axutil_env_t *env);
00113
00119 AXIS2_EXTERN axis2_http_header_t* AXIS2_CALL
00120 axis2_http_simple_response_get_first_header(axis2_http_simple_response_t *simple_response,
00121 const axutil_env_t *env,
00122 const axis2_char_t *str);
00123
00130 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00131 axis2_http_simple_response_remove_headers(axis2_http_simple_response_t *simple_response,
00132 const axutil_env_t *env,
00133 const axis2_char_t *str);
00134
00141 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00142 axis2_http_simple_response_set_header(axis2_http_simple_response_t *simple_response,
00143 const axutil_env_t *env,
00144 axis2_http_header_t* header);
00145
00153 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00154 axis2_http_simple_response_set_headers(axis2_http_simple_response_t *simple_response,
00155 const axutil_env_t *env,
00156 axis2_http_header_t** headers,
00157 axis2_ssize_t array_size);
00158
00163 AXIS2_EXTERN const axis2_char_t* AXIS2_CALL
00164 axis2_http_simple_response_get_charset(axis2_http_simple_response_t *simple_response,
00165 const axutil_env_t *env);
00166
00171 AXIS2_EXTERN axis2_ssize_t AXIS2_CALL
00172 axis2_http_simple_response_get_content_length(axis2_http_simple_response_t *simple_response,
00173 const axutil_env_t *env);
00174
00179 AXIS2_EXTERN const axis2_char_t* AXIS2_CALL
00180 axis2_http_simple_response_get_content_type(axis2_http_simple_response_t *simple_response,
00181 const axutil_env_t *env);
00182
00189 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00190 axis2_http_simple_response_set_body_string(axis2_http_simple_response_t *simple_response,
00191 const axutil_env_t *env,
00192 axis2_char_t *str);
00193
00200 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00201 axis2_http_simple_response_set_body_stream(axis2_http_simple_response_t *simple_response,
00202 const axutil_env_t *env,
00203 axutil_stream_t *stream);
00204
00209 AXIS2_EXTERN axutil_stream_t* AXIS2_CALL
00210 axis2_http_simple_response_get_body(axis2_http_simple_response_t *simple_response,
00211 const axutil_env_t *env);
00212
00218 AXIS2_EXTERN axis2_ssize_t AXIS2_CALL
00219 axis2_http_simple_response_get_body_bytes(axis2_http_simple_response_t *simple_response,
00220 const axutil_env_t *env,
00221 axis2_char_t **buf);
00222
00228 AXIS2_EXTERN void AXIS2_CALL
00229 axis2_http_simple_response_free(axis2_http_simple_response_t *simple_response,
00230 const axutil_env_t *env);
00231
00239 AXIS2_EXTERN axis2_http_simple_response_t * AXIS2_CALL
00240 axis2_http_simple_response_create (
00241 const axutil_env_t *env,
00242 axis2_http_status_line_t *status_line,
00243 const axis2_http_header_t **http_headers,
00244 const axis2_ssize_t http_hdr_count,
00245 axutil_stream_t *content);
00246
00250 AXIS2_EXTERN axis2_http_simple_response_t * AXIS2_CALL
00251 axis2_http_simple_response_create_default(
00252 const axutil_env_t *env);
00253
00254
00256 #ifdef __cplusplus
00257 }
00258 #endif
00259
00260 #endif