class TikToker::Request

Overview

A TikToker::Request is a wrapper around an URI to represent a TikTok API request.

request = TikToker::Request.new("/api/post/item_list/")
request.add("secUid", "0x1111")
request.to_s # => "https://m.tiktok.com/api/post/item_list?secUid=0x1111"

Defined in:

tiktoker/request.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String, query = URI::Params.new) #

[View source]

Instance Method Detail

def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def add(name : String, value) : Nil #

Sets (and overrides) the name query param to value.

request = TikToker::Request.new("/")
request.add("did", "0x1111111")
request.has_key?("did") # => true
request["did"]          # => "0x1111111"

[View source]
def build : String #

Builds the request URL.

request = TikToker::Request.new("/")
request.add("secUid", "0x1111111")
request.to_s # => "https://m.tiktok.com/?secUid=0x1111111"

[View source]
def has_key?(*args, **options) #

[View source]
def has_key?(*args, **options, &) #

[View source]
def query_params(*args, **options) #

[View source]
def query_params(*args, **options, &) #

[View source]
def to_s : String #

Builds the request URL.

request = TikToker::Request.new("/")
request.add("secUid", "0x1111111")
request.to_s # => "https://m.tiktok.com/?secUid=0x1111111"

[View source]
def uri : URI #

[View source]