Skip to content
Some simple but useful URL utils
Other Shell
  1. Other 96.8%
  2. Shell 3.2%
Branch: master
Clone or download

Latest commit

Latest commit 7f3e215 Apr 23, 2017

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/PostCocoon
t
.gitignore
.travis.yml Initial commit Apr 23, 2017
META6.json
README.md
build_readme.sh Add README builder and README Apr 23, 2017

README.md

TITLE

PostCocoon::Url

SUBTITLE

Some simple but useful URL utils

SYNOPSIS

A collection of functions that can be used for URL parsing, building and changing.

Also provides an loose URL tokenizer

sub url-encode

sub url-encode(
    Str $data
) returns Str

Transforms an string into an percent encoded string

sub url-decode

sub url-decode(
    Str $data
) returns Str

Transforms an percent encoded string into an plain string

sub build-query-string

sub build-query-string(
    Hash $hash
) returns Str

Build an query string from an Hash

sub build-query-string

sub build-query-string(
    *%hash
) returns Str

Build an query string from the named arguments

sub parse-query-string

sub parse-query-string(
    Str $query-string
) returns Hash

Parse a query string

class PostCocoon::Url::URL-Parser

Loose URL parser that doesn't follow RFC3986 not completly.

sub is-valid-url

sub is-valid-url(
    Str $uri
) returns Bool

Check if something is a valid url according to the parser

sub parse-url

sub parse-url(
    Str $uri
) returns Hash

Return an hash with all items of the url

sub build-url

sub build-url(
    Hash $hash
) returns Str

Build an url from given hash, this function does no error checking at all, it may result in an invalid url

sub build-url

sub build-url(
    *%hash
) returns Str

Build an url from given named parameters, this function does no error checking at all, it may result in an invalid url

You can’t perform that action at this time.