通过(撇号-headless)REST API 插入/更新片段及其字段 [英] Inserting/Updating pieces and its fields via (apostrophe-headless) REST API

查看:51
本文介绍了通过(撇号-headless)REST API 插入/更新片段及其字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Postman 来测试 api 结果.我一直在关注撇号无头文档,因为我对此完全陌生.所以我需要的是在 Postman 中提交一个 post 请求,以从 REST api 添加一个片段及其字段.我已经获得了不记名令牌并且登录成功.但是当我插入一个带有正文的部分作为 JSON 模式时.我收到一条错误消息.可能是我做的方式不对.那么一个人可以帮助我至少通过 POSTMAN 提出一个帖子请求来添加片段和字段吗?

Am am currently using Postman to test the api results. I have been following the apostrophe headless docs, since am completely new to this. so what i need is to submit a post request in Postman to add a piece and its fields from REST api. I have got the bearer token and login was success. but when i insert a piece with body as JSON schema. am getting a error message. May be the way am doing is wrong. so can one one help me in Making a post request to add piece and fields through POSTMAN atleast?

推荐答案

我没有完全理解这个问题.您应该添加一些输入、错误消息、网址、图片等以澄清问题.但是,如果您需要一个如何使用邮递员发出 POST 请求的示例,则是这样的:

I did not understand the question quite right. You should add some of your inputs, error message, url, pics and etc. to clarify the problem. However, if you need an example to how to use postman to make a POST request, it's like this:

  1. 选择 POST 方法并插入 API URL(POST 方法的登陆 url 而不是视图等)
  2. 转到标题选项卡并将授权令牌添加到标题
  3. 选择正文选项卡;然后是原始类型,最后是 JSON 类型.现在插入 Json 正文并单击发送.
  4. 您可以在响应窗口的顶部看到 webservice 调用的结果.如果返回 200,则一切正常.

这篇关于通过(撇号-headless)REST API 插入/更新片段及其字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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