Postman是API开发人员共享,测试,记录和监控API的工具链。
有没有办法将生成的swagger.json作为集合导入到Postman中? 我尝试导入它,但端点未显示在 Postman 中? 我正在使用 NestJs 和 Swagger + Postman
错误:在Postman中连接ECONNREFUSED 127.0.0.1:8080
在邮递员中测试基本项目,但得到 “错误:连接 ECONNREFUSED 127.0.0.1:8080”。 我正在通过表单数据中的邮递员上传多部分文件中的图像以及 JSON 对象...
如何通过postman从Azure AD获取lastSignInDateTime
我需要通过邮递员从Azure AD获取lastSignInDateTime。 我可以知道如何获取用户的详细信息吗 我尝试使用以下网址,但它对我不起作用。 “https://graph.micr...
在 Apache Jmeter 中出现错误“HTTP/1.1 431 请求标头字段太大”
我在 Jmeter 中有一个 API,我在其中传递一个令牌(从以前的 API 中提取),但收到错误:HTTP/1.1 431 请求标头字段太大。 为了传递标头,我正在使用 HHTP 标头 Ma...
我在 azure 中创建了一个管道,其中只有一个文件 azure-pipelines.yml 通过邮递员,我想使用标准授权向此管道发送 HTTP POST 请求。我想要一个全球
Post 命令在 C# 应用程序中不起作用,但在 postman 中工作正常
我创建了一个服务器代码,它通过 post 命令接受文件。 服务器端代码: app.MapPost("/upload2", async (IFormFile 文件) => { 列出有效扩展...
var stompClient = Stomp.over(function () { 退回袜子; }); console.log("con 之前"); stompClient.connect({}, () => { 设置已连接; stompClient.subscribe("/topic/hello&...
我正在尝试使用 Postman 为我的应用程序获取新的访问令牌,但我在响应中收到此错误: 有人可以帮我弄这个吗? 当我发送新令牌的请求时,我发送了请求...
.NET8 ASP.NET Core Web API:JWT 错误:承载错误 =“invalid_token”
我正在开发一个 ASP.NET Core 8 Web API 项目,我必须使用 JWT 令牌。但无论我做什么,我都面临着一个错误。我可以在登录时生成令牌,但是当我尝试使用
测试我的路线时,我收到错误 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();
设置 Azure Pipeline 以接收具有标准授权的 HTTP POST 请求
我在 azure 中创建了一个管道,其中只有一个文件 azure-pipelines.yml - 主要的 水池: 名称:默认 脚步: - 脚本:echo 你好,世界! displayName: '运行一行脚本' - 脚本:...
我安装了新的 Drupal 7.56 发行版。 我想通过java客户端创建新节点。 然而,经过一番谷歌搜索后,我发现了 Drupal 7 的“服务”模块。 所以我安装了它,下一个
从 JSON 文件中获取特定的 JSON 对象并将其写入另一个 JSON 文件
在邮递员项目中,我在单个环境 JSON 文件中维护多个变量。 为了维护代码,我想从 JSON 文件中获取特定的对象,这意味着所需的对象并写入新的
为什么当我尝试使用查询 ID 调用 api 时会收到错误 404?
我正在使用此 api 调用来检索平面工作项列表: 发布 https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql?api-version=7.1-preview.2 我能够拿到清单,所以现在...
Postman 休息调用在 Windows 11 中无法正常工作到 vs code
我正在使用 VS Code 在 Spring Boot 中编写一些代码。只是出于测试目的以确保一切正常,我正在使用 POSTMAN 和浏览器测试对我的控制器类的 REST API 调用。
为什么我在 PhpStorm HTTP 客户端和 Laravel HTTP 客户端中遇到超时,但在 Postman 中却没有?
当我使用 Postman 发送简单的 GET 请求时,这持续大约需要 228 毫秒并产生 json 响应。正如您所看到的,我在请求中禁用了 cookie 和标头,以获得完全相同的要求...
我想导出 gRPC 集合。我该怎么做?不幸的是,Postman 中没有执行此操作的选项。 是否有其他方法可以导出 gRPC 集合?有什么建议吗...
来自 ch.fortysix 的 Maven-postman-plugin 配置用于目标 Surefire-mail 获取 SurefireMailMojo 未知来源
我正在尝试发送一封电子邮件,其中包含 surfire-report 作为附件。我按照文档描述进行了 Surefire-mail 的配置,但出现以下错误: com.google.inject.
基本身份验证在使用 Postman 时不起作用,但在浏览器上可以工作
我的 Spring Boot Web 应用程序使用浏览器运行良好。当我尝试在不登录的情况下访问应用程序中的任何 URL 时,应用程序会将我转发到登录页面,当我登录时,我可以成功访问...
Google Apps 脚本 doGet() 函数无法识别查询字符串
我正在与谷歌应用程序脚本进行以下通信: $.get(url, "name=alice&n=1&n=2", 函数(数据) { ... }).fail(函数(xhr,状态,错误){ ... })...