Module: tastypie/lib/http

provides helper methods to send appropriate responses to http requests

Since:
  • 0.0.1
Author:
  • Eric Satterwhite
Source:

Methods


<static> accepted(name, message)

Http 202 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> badGateway(reply, data, status)

Http 502 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> badRequest(reply, data, status)

Http 401 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> checkpoint(name, message)

Http 103 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> conflict(reply, data, status)

Http 409 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> created(name, message)

Http 201 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> expectationFailed(reply, data, status)

Http 417 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> forbidden(reply, data, status)

Http 403 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> found(location, name, message)

Http 302 status

Parameters:
Name Type Description
location String

a url to set in the location header for redirects

name String

Name of the exception

message String

message to be displayed

Source:

<static> gatewayTimeout(reply, data, status)

Http 504 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> httpVersionNotSupported(reply, data, status)

Http 505 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> insufficientStorage(reply, data, status)

Http 507 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> lengthRequired(reply, data, status)

Http 411 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> methodNotAllowed(reply, data, status)

Http 405 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> movedPermanently(location, name, message)

Http 301 status

Parameters:
Name Type Description
location String

a url to set in the location header for redirects

name String

Name of the exception

message String

message to be displayed

Source:

<static> multipleChoices(name, message)

Http 300 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> noContent(name, message)

Http 204 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> nonAutoritative(name, message)

Http 203 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> notAcceptable(reply, data, status)

Http 406 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> notFound(reply, data, status)

Http 404 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> notImplemented(reply, data, status)

Http 501 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> ok(name, message)

Everything is fine ( 200 OK )!

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> partialContent(name, message)

Http 206 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> preconditionFailed(reply, data, status)

Http 412 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> processing(name, message)

Http 102 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> proxyAuthenticationRequired(reply, data, status)

Http 407 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> requestEntityTooLarge(reply, data, status)

Http 413 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> requestTimeout(reply, data, status)

Http 408 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> resetContent(name, message)

Http 205 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> resourceGone(reply, data, status)

Http 410 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> resumeIncomplete(reply, data, status, location)

Http 308 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

location String

a url to set in the location header for redirects

Source:

<static> seeOther(location, reply, data, status, location)

Http 303 status

Parameters:
Name Type Description
location String

a url to set in the location header for redirects

reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

location String

a url to set in the location header for redirects

Source:

<static> serverError(reply, data, status)

Http 500 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> serviceUnavailable(reply, data, status)

Http 503 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> switching(name, message)

Http 101 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source:

<static> switchProxy(reply, data, status, location)

Http 306 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

location String

a url to set in the location header for redirects

Source:

<static> temporaryRedirect(reply, data, status, location)

Http 307 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

location String

a url to set in the location header for redirects

Source:

<static> tooManyRequests(reply, data, status)

Http 429 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> unauthorized(reply, data, status)

Http 401 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> unprocessableEntity(reply, data, status)

Http 422 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<static> unsupportedMediaType(reply, data, status)

Http 415 status

Parameters:
Name Type Description
reply Response

Hapijs reply object

data String

String data to send in the response

status Number

The http status code to set on the response

Source:

<inner> continue(name, message)

Http 100 status

Parameters:
Name Type Description
name String

Name of the exception

message String

message to be displayed

Source: