Skip to content

Instance Method

get(_:)

Grabs the named parameter from the parameter bag.
func get(_ name: String) -> String?

Parameters

name

The name of the parameter to retreive.

Return Value

The value of the parameter, if it exists.

Discussion

For example GET /posts/:post_id/comments/:comment_id would be fetched using:

let postID = parameters.get("post_id")
let commentID = parameters.get("comment_id")