草庐IT

post-name

全部标签

amazon-web-services - 转到 AWS SDK "Unable to determine service/operation name to be authorized"

我正在使用GoSDK连接到KinesisVideoStreams服务。发出GetMedia请求时,我收到了包含以下正文的403响应:Unabletodetermineservice/operationnametobeauthorized我正在使用LogLevelLogDebugWithHTTPBody查看此内容,因为SDK需要JSON并接收XML,从而导致SerializationError。我正在使用Go1.9.2并尝试对aws-sdk-go的v1和v2进行此操作,结果相同。这是我的要求:POST/getMediaHTTP/1.1Host:kinesisvideo.us-west-2

go - 在 golang 中创建一个 POST 策略并为基于浏览器的上传到 Amazon S3 签名

我正在尝试从我的客户端(AngularJS)实现基于浏览器的上传到亚马逊S3,经过一些研究我开始知道我必须创建一个策略并签署S3的POST请求。引用http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html,我试过http://play.golang.org/p/3zn5fSDasKpackagemainimport"fmt"import"encoding/base64"funcmain(){bytePolicy:=[]byte(`{"expiration":"2013-08-06T12:00:00.00

go - 使用表单数据和身份验证在 Go 中发出 POST 请求

我目前正在尝试使用示例curl命令与OAuthapi交互curl-u{client_id}:{client_secret}-dgrant_type=client_credentialshttps://us.battle.net/oauth/token.我当前的go文件是:packagemainimport("bytes""fmt""mime/multipart""net/http")funccheckErr(errerror)bool{iferr!=nil{panic(err)}returntrue}funcauthcode(idstring,secretstring,clihttp.

mysql - GoLang 的配置返回 "non-name"错误

我在编译Google-Cloud提供的使用Golang远程连接到mysql数据库的代码时遇到问题。代码是从此处直接复制粘贴的:https://cloud.google.com/sql/docs/mysql/connect-external-app#go。也可以看这里:https://github.com/GoogleCloudPlatform/cloudsql-proxy/blob/master/proxy/dialers/mysql/hook_test.go。我已经尝试为下面的第一行提供第二个变量,但是出现错误,因为mysql函数只返回一个值。麻烦的代码在第二行,可能是第一行的原因。

go - x/手机 : Launch a android application with given package name [String] in go

下面是用go写的函数:funcLaunchApplication(packageNamestring){Query:howcanIexecuteapplicationwithgivenpackageName}使用gomobile生成java绑定(bind)[.aar]。我想包含在我的android应用程序中生成的.aar,并从java层调用LaunchApplication("com.package.name")到本地go层,go层应该运行该应用程序。在java应用中,使用包名运行apk的方法如下:Processprocess=Runtime.getRuntime().exec("am

post - 在 fcgi 上的 Golang 中获取 GET 请求

我在Apache下运行我的脚本。我了解如何创建请求,例如:http.Get(url)如何获取GET请求?我真的没有在文档中看到这些信息。提前致谢!更新例如,我从另一个脚本对我的go脚本执行GET或POST请求。在PHP中,我只写$a=$_GET["param"]。我怎么能在围棋中做到这一点?抱歉英语不好,顺便说一下 最佳答案 您的处理程序传递了一个Request.在该请求中,您在使用ParseForm解析它后立即在Form字段中找到参数。://Formcontainstheparsedformdata,includingbothth

json - 如何解析json post请求

我想将json数据发布到Goapi,但我无法在Go中解析jsonjavascript代码:data={"user":{"username":"admin","password":"123"},"profile":{"firstname":"morteza","lastname":"khadem","files":["/temp/a.jpg","/temp/b.jpg"]}}$.post('/parse-json',data,function(){alert('success');});在php中获取数据非常简单($_REQUEST['user']['firstname'])但在Go中不

reactjs - AWS ELB 为 https ://domain_name:8000 but accessible via public_ip:8000 返回 404

我是在AWS上部署Web应用程序的初学者,我相信我遇到了与AWSforwardport8000fromelbtoport8000ofEC2类似的问题我有一个reactjs前端和golangapi在awsec2上运行,golangapi在端口8000上运行,可以通过我的public_ip:8000访问它,并给我消息说当我访问public_ip:8000时我的golangapi正在运行。我使用弹性IP创建了public_ip。我使用负载平衡器来获得HTTPS,因为我有一些只能与HTTPS一起使用的功能。然而,当我使用我的https://domain_name:8000时向我自己的API发送

dictionary - 如何将 POST 正文绑定(bind)到 map ?

我一直在使用Gin的ShouldBind()方法将表单数据绑定(bind)到结构:typeUpdateUserInfoContextstruct{Countrystring`json:"country"`EmailAddrstring`json:"emailAddr"`LoginIDstring`json:"loginID"`UserNamestring`json:"username"`}func(h*handler)updateUserInfo(ctx*gin.Context){varjsonUpdateUserInfoContextiferr:=ctx.ShouldBind(&js

post - 如何通过POST发送参数

资源接收参数示例:http://example.com/show-data?json={"fob":"bar"}在GET请求的情况下,一切正常且运行良好。urlStr:="http://87.236.22.7:1488/test/show-data"json:=`"foo":"bar"`r,_:=http.Get(urlStr+`?json=`+json)println(r.Status)200OK但是使用POST请求应该怎么办呢?我试试urlStr:="http://87.236.22.7:1488/test/show-data"json:=`{"foo":"bar"}`form:=