问题描述
我正在尝试使用邮递员中提供的API获取对象存储容器的详细信息,但是我遇到了未经授权的错误,
在
如您所见,我成功完成了该请求。因此,我需要响应中的 标题信息,例如以下示例:
2。检索容器
获得 X-Storage-Url 和 X-Storage-Token 后,您可以像下面的示例一样检索容器:
我希望它可以帮助您使用Postman访问对象存储,请让我知道任何疑问或评论。
I am trying to get object storage container details using provided API in post man But I am getting Unauthorized error,
API information available athttp://developer.openstack.org/api-ref/object-storage/index.html?expanded=get-object-content-and-metadata-detail,show-account-details-and-list-containers-detail#accounts
Following details I am set in PostMan,
Method Get
Url: https://{domain}.objectstorage.softlayer.net/auth/v1.0/{userid}?format=json
Header: Key: X-Auth-Token Value: {token}
Error got in response of PostMan,
<html>
<h1>Unauthorized</h1>
<p>This server could not verify that you are authorized to access the document you requested.</p>
</html>
To retrieve containers from Object Storage using Postman, follow these steps:
1. We need to generate the token to access Object Storage
You need to get credentials from your object storage, so you can go to:
You will be able to see
- "Authentication Endpoint (public and private)"
- "username"
- "API Key (Password)"
Then, you can go to postman and fill as the below example:
As you see, I had success with the request. So I need the "Headers" information from the response, as the follow example:
2. Retrieve containers
After getting "X-Storage-Url" and "X-Storage-Token", you can retrieve the containers as the example below:
I hope it helps you to access Object Storage using Postman, please let me know any doubt or comment.
这篇关于从Postman的API连接对象存储时发生未经授权的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!