src/puppy

Source   Edit  

Procs

proc delete(url: string; headers = emptyHttpHeaders(); timeout: float32 = 60.0): Response {.
    ...raises: [PuppyError, CatchableError], tags: [], forbids: [].}
Source   Edit  
proc fetch(req: Request): Response {....raises: [PuppyError], tags: [], forbids: [].}
Source   Edit  
proc fetch(url: string; headers = emptyHttpHeaders()): string {.
    ...raises: [PuppyError, CatchableError], tags: [], forbids: [].}
Simple fetch that directly returns the GET response body. Raises an exception if anything goes wrong or if the response code is not 200. See get, post, put etc for similar calls that return a response object. Source   Edit  
proc get(url: string; headers = emptyHttpHeaders(); timeout: float32 = 60.0): Response {.
    ...raises: [PuppyError, CatchableError], tags: [], forbids: [].}
Source   Edit  
proc head(url: string; headers = emptyHttpHeaders(); timeout: float32 = 60.0): Response {.
    ...raises: [PuppyError, CatchableError], tags: [], forbids: [].}
Source   Edit  
proc newRequest(url: string; verb = "get"; headers = emptyHttpHeaders();
                timeout: float32 = 60.0): Request {....raises: [CatchableError],
    tags: [], forbids: [].}
Allocates a new request object with defaults. Source   Edit  
proc patch(url: string; headers = emptyHttpHeaders(); body: sink string = "";
           timeout: float32 = 60.0): Response {.
    ...raises: [CatchableError, PuppyError], tags: [], forbids: [].}
Source   Edit  
proc post(url: string; headers = emptyHttpHeaders(); body: sink string = "";
          timeout: float32 = 60.0): Response {.
    ...raises: [CatchableError, PuppyError], tags: [], forbids: [].}
Source   Edit  
proc put(url: string; headers = emptyHttpHeaders(); body: sink string = "";
         timeout: float32 = 60.0): Response {.
    ...raises: [CatchableError, PuppyError], tags: [], forbids: [].}
Source   Edit