Gitlab API:如何生成的是专用令牌 [英] Gitlab API: How to generate the private token

查看:577
本文介绍了Gitlab API:如何生成的是专用令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的尝试:

卷曲http://git.ep.petrobras.com.br/api/v3/session --data-urlen code'登录= MYUSER&放大器;密码=为mypass'

答:
{消息:401未授权}

推荐答案

的问题是数据urlen code 卷曲选项。因为它是一个HTTP POST,你不需要URL连接code的数据,实际上是编码&安培; &放大器;放大器; ,造成您的问题。相反,使用 - 数据选项

The problem is the data-urlencode CURL option. Since it's an HTTP POST you don't need to URL encode the data, and is actually encoding the & into & and causing your issue. Instead use the --data option.

curl http://git.ep.petrobras.com.br/api/v3/session --data 'login=myUser&password=myPass'

此外,小心通过纯HTTP发送凭据。它可以很容易地嗅了嗅。

Also, be careful sending credentials over plain HTTP. It could be easily sniffed.

这篇关于Gitlab API:如何生成的是专用令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆