postman 相关问题

Postman是API开发人员共享,测试,记录和监控API的工具链。

语法错误:通过 Postman 中的 POST 请求在位置 1(第 1 行第 2 列)的 JSON 中减号后没有数字

当我在我的网站应用程序上使用我的 API 时,它工作得很好,但是当我尝试在 Postman 中测试它时,我得到 SyntaxError: No number after minus sign in JSON atposition 1 (line 1 column 2)。 ...

回答 1 投票 0

错误:标头名称必须是有效的 HTTP 令牌 [“API 密钥”]

您好,邮递员服务台。 我正在研究 FreshServices API,为此我正在使用 Postman 测试 API,但我收到如下错误: 在此输入图像描述 你可以去吗

回答 1 投票 0

未处理的异常:HandshakeException:握手期间连接终止

我是颤振新手。我连接到本地 API。我收到错误: 连接终止 导入“包:flutter/material.dart”; 将'package:http/http.dart'导入为http; 导入'dart:异步';

回答 3 投票 0

无法使用 mongodb 在 akka http 中将 scala.concurrent.impl.Promise$Transformation 转换为 scala.collection.immutable.Seq 错误?

基本上我尝试使用akka http从数据库获取数据。如果我直接在 api 中传递 (EmployeeRepo.findAll()) 那么它会显示所有数据,但是在使用 actor 时它会显示转换错误...... 这里的问题...

回答 2 投票 0

Postman 中的 setNextRequest()

我试图在邮递员中的某个请求之后设置一个请求,但它没有按照我想要的方式工作。我已阅读 Postman 文档,但没有运气。另外,我如何获得邮递员的回复...

回答 2 投票 0

404 未找到邮递员

我运行我的 Spring 应用程序,它没有显示任何错误,这是我的控制器 包com.testAOP.controller; 导入 org.springframework.beans.factory.annotation.Autowired; 导入 org.springframewo...

回答 1 投票 0

用于多部分/表单数据的 POSTMAN

如何使用 POSTMAN 进行 Multipart/form-data,它具有自定义标头来测试我的控制器,该控制器采用 2 个文件作为参数(public ...controller( MultipartFile[] files))? POST .... HTTP/1 ....

回答 5 投票 0

邮递员中的发送按钮

我的 Postman 应用程序遇到问题。界面中似乎缺少“发送”请求按钮。我正在尝试发送请求,但无法发送请求,因为按钮

回答 1 投票 0

如何从邮递员向后端发送stomp(websocket)消息?

有后端spring boot和stomp(websocket下的协议) 所以,我使用了 git https://github.com/spring-guides/gs-messaging-stomp-websocket 的官方示例 并开始了。我猫使用 js 客户端...

回答 1 投票 0

NestJs Swagger for Postman

有没有办法将生成的swagger.json作为集合导入到Postman中? 我尝试导入它,但端点未显示在 Postman 中? 我正在使用 NestJs 和 Swagger + Postman

回答 3 投票 0

错误:在Postman中连接ECONNREFUSED 127.0.0.1:8080

在邮递员中测试基本项目,但得到 “错误:连接 ECONNREFUSED 127.0.0.1:8080”。 我正在通过表单数据中的邮递员上传多部分文件中的图像以及 JSON 对象...

回答 1 投票 0

如何通过postman从Azure AD获取lastSignInDateTime

我需要通过邮递员从Azure AD获取lastSignInDateTime。 我可以知道如何获取用户的详细信息吗 我尝试使用以下网址,但它对我不起作用。 “https://graph.micr...

回答 1 投票 0

在 Apache Jmeter 中出现错误“HTTP/1.1 431 请求标头字段太大”

我在 Jmeter 中有一个 API,我在其中传递一个令牌(从以前的 API 中提取),但收到错误:HTTP/1.1 431 请求标头字段太大。 为了传递标头,我正在使用 HHTP 标头 Ma...

回答 1 投票 0

具有标准授权的 HTTP POST 请求

我在 azure 中创建了一个管道,其中只有一个文件 azure-pipelines.yml 通过邮递员,我想使用标准授权向此管道发送 HTTP POST 请求。我想要一个全球

回答 1 投票 0

Post 命令在 C# 应用程序中不起作用,但在 postman 中工作正常

我创建了一个服务器代码,它通过 post 命令接受文件。 服务器端代码: app.MapPost("/upload2", async (IFormFile 文件) => { 列出有效扩展...

回答 1 投票 0

无法使用 stomp.js 连接到 STOMP

var stompClient = Stomp.over(function () { 退回袜子; }); console.log("con 之前"); stompClient.connect({}, () => { 设置已连接; stompClient.subscribe("/topic/hello&...

回答 1 投票 0

Postman 响应错误中未找到访问令牌

我正在尝试使用 Postman 为我的应用程序获取新的访问令牌,但我在响应中收到此错误: 有人可以帮我弄这个吗? 当我发送新令牌的请求时,我发送了请求...

回答 1 投票 0

.NET8 ASP.NET Core Web API:JWT 错误:承载错误 =“invalid_token”

我正在开发一个 ASP.NET Core 8 Web API 项目,我必须使用 JWT 令牌。但无论我做什么,我都面临着一个错误。我可以在登录时生成令牌,但是当我尝试使用

回答 1 投票 0

测试我的路线时,我收到错误 404 在 Postman 上找不到

这是我的类别表迁移文件中包含的代码: 这是我的类别表迁移文件中包含的代码: <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('categories', function (Blueprint $table) { $table->id(); $table->foreignId('parent_id')->nullable()->constrained('categories')->onDelete('cascade'); $table->string('name'); $table->string('icon')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('categories'); } }; 这是我的 Category.php 模型文件中包含的代码: <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Category extends Model { use HasFactory; protected $fillable = ['parent_id', 'name', 'icon']; public function scopeParentCategories($query) { return $query->whereNull('parent_id'); } public static function tree() { $allCategories = Category::get(); $rootCategories = $allCategories->whereNull('parent_id'); self::buildTree($rootCategories, $allCategories); return $rootCategories; } public function children() { return $this->hasMany(Category::class, 'parent_id'); } public function items() { return $this->belongsToMany(Item::class, 'category_items'); } public function saveSubCategories($subCategories) { foreach($subCategories as $subCategory) { $this->saveSubCategory($subCategory); } } public function saveSubCategory($subCategory) { $newSubCategory = new self(); $newSubCategory->fill($subCategory); $newSubCategory->setAttribute('parent_id', $this->id); $newSubCategory->save(); } private static function formatTree($categories, $allCategories) { foreach ($categories as $category) { $category->children = $allCategories->where('parent_id', $category->id)->values(); if ($category->children->isNotEmpty()) { self::formatTree($category->children, $allCategories); } } } } 这是我的 CategoryController.php 控制器文件中包含的代码: <?php namespace App\Http\Controllers; use App\Models\Category; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; class CategoryController extends Controller { /** * Display a listing of the resource. */ public function index() { return Category::all(); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(Request $request) { $validator = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'icon' => 'nullable|string|max:255', 'children.*.name' => 'required|string|max:255', 'children.*.icon' => 'required|string|max:255', 'children.*.parent_id' => 'nullable|exists:categories,id', ]); if ($validator->fails()) { return response()->json(['errors' => $validator->errors()], 400); } $category = Category::create($request->only('name', 'icon')); if ($request->has('children')) { foreach ($request->children as $childData) { $child = new Category($childData); $child->parent_id = $category->id; $child->save(); } } return $category; } /** * Display the specified resource. */ public function show(Category $category) { return Category::find($category); } /** * Show the form for editing the specified resource. */ public function edit(Category $category) { // } /** * Update the specified resource in storage. */ public function update(Request $request, Category $category) { $category = Category::findOrFail($category); $validator = Validator::make($request->all(), [ 'name' => 'required|string|max:255', 'parent_id' => 'nullable|exists:categories,id', 'icon' => 'nullable|string|max:255', ]); if ($validator->fails()) { return response()->json(['errors' => $validator->errors()], 400); } $category->update($request->all()); return response()->json($category); } /** * Remove the specified resource from storage. */ public function destroy(Category $category) { $category = Category::findOrFail($category); $category->delete(); return response()->json($category); } } 这是我的 api.php 路由文件中包含的代码: <?php /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | */ use Illuminate\Support\Facades\Route; use App\Http\Controllers\CategoryController; use App\Http\Controllers\ItemController; use App\Http\Controllers\ItemOptionController; use App\Http\Controllers\OptionController; use App\Http\Controllers\OptionValueController; use App\Http\Controllers\OrderController; use App\Http\Controllers\OrderItemController; use App\Http\Controllers\PaymentController; use App\Http\Controllers\QRCodeController; use App\Http\Controllers\TableLayoutController; // API version prefix Route::prefix('v1')->group(function () { // Routes for managing categories Route::get('categories', [CategoryController::class, 'index']); Route::post('categories', [CategoryController::class, 'store']); Route::get('categories/{category}', [CategoryController::class, 'show']); Route::put('categories/{category}', [CategoryController::class, 'update']); Route::delete('categories/{category}', [CategoryController::class, 'destroy']); // Routes for managing items Route::get('items', [ItemController::class, 'index']); Route::post('items', [ItemController::class, 'store']); Route::get('items/{item}', [ItemController::class, 'show']); Route::put('items/{item}', [ItemController::class, 'update']); Route::delete('items/{item}', [ItemController::class, 'destroy']); // Routes for managing orders Route::get('orders', [OrderController::class, 'index']); Route::post('orders', [OrderController::class, 'store']); Route::get('orders/{order}', [OrderController::class, 'show']); Route::put('orders/{order}', [OrderController::class, 'update']); Route::delete('orders/{order}', [OrderController::class, 'destroy']); // Routes for managing payments Route::get('payments', [PaymentController::class, 'index']); Route::post('payments', [PaymentController::class, 'store']); Route::get('payments/{payment}', [PaymentController::class, 'show']); Route::put('payments/{payment}', [PaymentController::class, 'update']); Route::delete('payments/{payment}', [PaymentController::class, 'destroy']); // Routes for managing options Route::get('options', [OptionController::class, 'index']); Route::post('options', [OptionController::class, 'store']); Route::get('options/{option}', [OptionController::class, 'show']); Route::put('options/{option}', [OptionController::class, 'update']); Route::delete('options/{option}', [OptionController::class, 'destroy']); // Routes for managing option values Route::get('option-values', [OptionValueController::class, 'index']); Route::post('option-values', [OptionValueController::class, 'store']); Route::get('option-values/{optionvalues}', [OptionValueController::class, 'show']); Route::put('option-values/{optionvalues}', [OptionValueController::class, 'update']); Route::delete('option-values/{optionvalues}', [OptionValueController::class, 'destroy']); // Routes for managing item options Route::get('item-options', [ItemOptionController::class, 'index']); Route::post('item-options', [ItemOptionController::class, 'store']); Route::get('item-options/{itemoptions}', [ItemOptionController::class, 'show']); Route::put('item-options/{itemoptions}', [ItemOptionController::class, 'update']); Route::delete('item-options/{itemoptions}', [ItemOptionController::class, 'destroy']); // Routes for managing order items Route::get('order-items', [OrderItemController::class, 'index']); Route::post('order-items', [OrderItemController::class, 'store']); Route::get('order-items/{orderItem}', [OrderItemController::class, 'show']); Route::put('order-items/{orderItem}', [OrderItemController::class, 'update']); Route::delete('order-items/{orderItem}', [OrderItemController::class, 'destroy']); // Routes for managing QR codes Route::get('qr-codes', [QRCodeController::class, 'index']); Route::post('qr-codes', [QRCodeController::class, 'store']); Route::get('qr-codes/{qrCode}', [QRCodeController::class, 'show']); Route::put('qr-codes/{qrCode}', [QRCodeController::class, 'update']); Route::delete('qr-codes/{qrCode}', [QRCodeController::class, 'destroy']); // Routes for managing table layouts Route::get('table-layouts', [TableLayoutController::class, 'index']); Route::post('table-layouts', [TableLayoutController::class, 'store']); Route::get('table-layouts/{tableLayout}', [TableLayoutController::class, 'show']); Route::put('table-layouts/{tableLayout}', [TableLayoutController::class, 'update']); Route::delete('table-layouts/{tableLayout}', [TableLayoutController::class, 'destroy']); }); 我正在使用 Postman 来测试我的 Laravel 应用程序后端。我正在 docker 上运行我的数据库。所有路线均无效,但我在此处显示类别作为参考。我尝试运行 post 方法但失败了 愚蠢的错误: 必须在 bootstrap->cache->app.php 中提及基本路径 <?php use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { // }) ->withExceptions(function (Exceptions $exceptions) { // })->create();

回答 1 投票 0

设置 Azure Pipeline 以接收具有标准授权的 HTTP POST 请求

我在 azure 中创建了一个管道,其中只有一个文件 azure-pipelines.yml - 主要的 水池: 名称:默认 脚步: - 脚本:echo 你好,世界! displayName: '运行一行脚本' - 脚本:...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.