连接对象存储时出现未经授权的错误

连接对象存储时出现未经授权的错误

本文介绍了从 Postman 的 API 连接对象存储时出现未经授权的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 post man 中提供的 API 获取对象存储容器的详细信息,但我收到了未经授权的错误,

API 信息可在

如您所见,我已成功完成请求.所以我需要响应中的Headers"信息,如下例所示:

2.检索容器

获取X-Storage-Url"和X-Storage-Token"后,可以检索容器如下图:

希望对您使用 Postman 访问 Object Storage 有所帮助,如有任何疑问或评论,请告诉我.

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 连接对象存储时出现未经授权的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-21 01:49