成都网站建设设计

将想法与焦点和您一起共享

创新互联IRIS教程:irisRESTfulAPI

iris同样支持RESTful API,具体使用方法如下

创新互联建站服务项目包括金州网站建设、金州网站制作、金州网页制作以及金州网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,金州网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到金州省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

package main

import "github.com/kataras/iris/v12"

func main() {
    app := iris.Default()
	//需自行添加对应函数
    app.Get("/someGet", getting)
	//func getting(ctx iris.Context){...}

    app.Post("/somePost", posting)
	//func posting(ctx iris.Context){...}

    app.Put("/somePut", putting)
	//func putting(ctx iris.Context){...}

    app.Delete("/someDelete", deleting)
	//func deleting(ctx iris.Context){...}

    app.Patch("/somePatch", patching)
	//func patching(ctx iris.Context){...}

    app.Header("/someHead", head)
	//func head(ctx iris.Context){...}

    app.Options("/someOptions", options)
	//func options(ctx iris.Context){...}

    app.Listen(":8080")
}


网站名称:创新互联IRIS教程:irisRESTfulAPI
路径分享:https://chengdu.cdxwcx.cn/article/dpegcej.html