Git Product home page Git Product logo

teheran's Introduction

Teheran

Teheran是一个简单的HTTP库,能让请求rest api更加简洁。body入参格式只支持json,其他场景还是建议使用Go标准库http。

image

Installation

Install Teheran using the "go get" command:

go get github.com/FastSchnell/Teheran/requests

Usage

import "Teheran/requests"

func testReq() {
    body := map[string]interface{}{"11": "22"}
    resp, err := requests.Post("http://112.74.200.115", requests.WithJson(body))
    if err != nil {
        fmt.Println(err.Error())
    }

    if resp.StatusCode == 404 {
        json, err := resp.Json()
        if err != nil {
            fmt.Println("json err", err.Error())
        }

        for k, v := range json {
            fmt.println(k, v)
        }
    }
}

License

Teheran is available under the Apache License, Version 2.0.

项目故事

为了纪念最痛苦的一次离职经历,2019.01.31-2019.02.28。个人称之为"逃离德黑兰"计划。

teheran's People

Contributors

fastschnell avatar

Stargazers

碎ping子 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.