Class: SFML::HttpResponse
- Inherits:
-
Object
- Object
- SFML::HttpResponse
- Defined in:
- ext/network/http.c,
ext/network/http.c
Overview
The status, headers and body returned by Http#send_request.
Instance Method Summary collapse
-
#body ⇒ String
Returns the body of the response.
-
#field(name) ⇒ String?
Returns the value of the response header field named
name. -
#major_version ⇒ Integer
Returns the major component of the HTTP protocol version.
-
#minor_version ⇒ Integer
Returns the minor component of the HTTP protocol version.
-
#status ⇒ Integer
Returns the numeric HTTP status code.
-
#status_name ⇒ Symbol
Returns the status as an HttpStatus name.
Instance Method Details
#body ⇒ String
Returns the body of the response.
308 309 310 |
# File 'ext/network/http.c', line 308 static VALUE HttpResponse_body(VALUE self) { return rb_str_new_cstr(sfHttpResponse_getBody(Get_HttpResponse_Struct(self))); } |
#field(name) ⇒ String?
Returns the value of the response header field named name.
253 254 255 256 257 258 |
# File 'ext/network/http.c', line 253
static VALUE HttpResponse_field(VALUE self, VALUE rb_field) {
const char* field =
sfHttpResponse_getField(Get_HttpResponse_Struct(self), StringValueCStr(rb_field));
return field != NULL ? rb_str_new_cstr(field) : Qnil;
}
|
#major_version ⇒ Integer
Returns the major component of the HTTP protocol version.
287 288 289 |
# File 'ext/network/http.c', line 287 static VALUE HttpResponse_major_version(VALUE self) { return UINT2NUM(sfHttpResponse_getMajorVersion(Get_HttpResponse_Struct(self))); } |
#minor_version ⇒ Integer
Returns the minor component of the HTTP protocol version.
297 298 299 |
# File 'ext/network/http.c', line 297 static VALUE HttpResponse_minor_version(VALUE self) { return UINT2NUM(sfHttpResponse_getMinorVersion(Get_HttpResponse_Struct(self))); } |
#status ⇒ Integer
Returns the numeric HTTP status code.
266 267 268 |
# File 'ext/network/http.c', line 266 static VALUE HttpResponse_status(VALUE self) { return INT2NUM(sfHttpResponse_getStatus(Get_HttpResponse_Struct(self))); } |
#status_name ⇒ Symbol
Returns the status as an HttpStatus name.
276 277 278 279 |
# File 'ext/network/http.c', line 276 static VALUE HttpResponse_status_name(VALUE self) { return ID2SYM( rb_intern(http_status_name(sfHttpResponse_getStatus(Get_HttpResponse_Struct(self))))); } |