api 相关问题

请勿使用:使用您所指的库,[api-design]或其他适当的标签进行标记。要求我们推荐或查找API的问题是偏离主题的。

即使拥有正确的权限,Facebook Graph API 错误 #200

我正在设置一个机器人来自动在 Facebook 页面上发帖。但是当我运行脚本时,图形 API 抛出以下错误: facebook.GraphAPIError: (#200) 如果发布到群组,则需要应用程序

回答 1 投票 0

PHP SOAP API 设置/登录

到目前为止我只使用过 WEB API,我无法弄清楚 SOAP 到底是如何工作的。 PHP 官方网站缺乏详细信息,并且几个示例对我没有多大帮助。我相信...

回答 2 投票 0

无法向 POST 请求添加请求标头

我通过使用有效负载来访问 API,并在标头中提供 Content-Type : 'application/json' 仍在浏览器中的请求标头中我看到 Content-Type : 'text/plain' 因为后面的那个...

回答 1 投票 0

Flutter 搜索 Spotify 歌曲并保存深层链接

在我的应用程序中,我希望能够搜索 Spotify 歌曲,并且在选择时应保存深层链接。再次单击该链接,用户应该被重定向到 Spotify 应用程序...

回答 2 投票 0

如何高效使用React Context API

我正在制作 React Web 应用程序,并且是初学者。当我使用 Context API 时,我遇到了一个问题。 这是我的代码。 从“react”导入 React, { createContext, useState, useEffect }; 导出常量

回答 1 投票 0

如何为 Jenkins 请求 crumb 发行者

我想使用 Jenkins Remote API,并且我正在寻找安全的解决方案。我遇到了防止跨站请求伪造漏洞,我想使用它,但我在某处读到你必须制作一个

回答 8 投票 0

使用 Azure 数据工厂检索 QuickBooks Online 总账数据的 API

我正在尝试使用 Azure 数据工厂通过 OAUTH2 连接到 QuickBooks Online General Ledger。我的方法是首先创建一个带有 Web Activity 的管道来执行 POST 调用来接收

回答 1 投票 0

如何使用/阅读api文档来发送简单的请求?

我知道这可能是严格针对具体情况的,但我确实觉得我经常遇到这个问题,所以我会努力尝试更好地理解它。 我刚开始使用 API,但从来没有

回答 2 投票 0

在 yii2 中 filsh oauth2(出现异常)

我正在尝试在 yii2 中实现 filsh oauth2。但我明白了 { "name": "异常", "message": "传递给 OAuth2\GrantType\ClientCredentials::__construct() 的参数 1 必须实现接口

回答 1 投票 0

是否有任何解决方案可以修复 NextResponse.json() 以使用 status:200 ,它拒绝在 nextjs 14 中编译?

这是我有的一个简单的 api 路由: // 从“../../../utils/db”导入 prisma; 从“next/server”导入{NextRequest,NextResponse}; 常量地址 = [ { 编号: 1, ...

回答 1 投票 0

即使第一次发出请求,Pytends api 也会抛出 429 错误

我正在使用非常简单的代码按地区查找关键字的数据。但每次我运行它时,它都会给我429错误,提示发出了太多请求,但实际上请求是......

回答 2 投票 0

如何用python对clickup进行评论?

我想在clickup中评论特定任务,但它响应401错误。 url =“https://api.clickup.com/api/v2/task/861m8wtw3/comment” 标题= { “授权”:“

回答 2 投票 0

传递的API密钥对于Postman中的Marvel API无效

我尝试在 Postman 上向 Marvel API 发出请求,但收到错误代码:401 { "code": "无效凭证", "message": "传递的API密钥无效....

回答 2 投票 0

API上是否有httpClient请求取消订单?

我想在我的应用程序中以 API 形式取消(而不是删除)Shopify 上的订单。 目前我正在使用这段代码来取消订单 公共 IActionResult 取消(双?id) { _httpClient.BaseAddress...

回答 1 投票 0

laravel 8 中 API 未返回最新数据

我的 flutter 应用程序使用 laravel 8。在此情况下,Api 在编辑/更新后不会返回最新数据。即使在另一个获取该数据的 api 上也是如此。 要添加数据,我使用以下代码: $输入=$请求...

回答 1 投票 0

图片未上传时图片值应为空

员工控制器 员工控制器 <?php namespace App\Http\Controllers; use App\Talent\Employee\Requests\EmployeeCreateRequest; use App\Talent\Employee\EmployeeManager; use Illuminate\Http\Response; use App\Talent\User\UserManager; use App\Talent\Documents\DocumentManager; use Illuminate\Support\Facades\Hash; class EmployeeController extends Controller { public function __construct(private EmployeeManager $employeeManager,private UserManager $userManager,private DocumentManager $documentManager) { } public function store(EmployeeCreateRequest $request){ $validated = $request->validated(); $userArray=[ 'name'=>$validated['first_name']." ".$validated['last_name'], 'email'=>$validated['email'], 'password'=>Hash::make("Introcept@123"), 'role'=>'user' ]; $userCreate=$this->userManager->store($userArray); return $this->employeeStore($validated,$userCreate,$request); } public function employeeStore($validated,$userCreate,$request){ if($request->hasFile($validated['avatar'])) { $validated['avatar']=$validated['avatar']->store('employeeimages','public'); } else { $validated['avatar']='null'; } $userId=$userCreate->id; $userIdArray=[ 'user_id'=>$userId, 'status'=>'Active', ]; $employeeArray=array_merge($validated,$userIdArray); $employeeCreate=$this->employeeManager->store($employeeArray); $employeeId=$employeeCreate->id; foreach($validated['documents'] as $document){ $name=$document->getClientOriginalName(); $type=$document->getClientMimeType(); $path=$document->store('employeedocuments','public'); $documentArray=[ 'employee_id'=>$employeeId, 'original_name'=>$name, 'type'=>$type, 'path'=>$path, ]; $documentCreate=$this->documentManager->store($documentArray); } return response([ 'userId'=>$userId, 'employeeId'=>$employeeId, 'message'=>'Personal detail added successfully', ],Response::HTTP_OK); } } Employee.php <?php namespace App\Talent\Employee\Model; use App\Talent\Documents\Model\Document; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Employee extends Model { use HasFactory; protected $fillable = [ 'first_name', 'last_name', 'email', 'contact_number', 'date_of_birth', 'current_address', 'pan_number', 'bank_account_number', 'avatar', 'status', 'user_id', ]; **EmployeeRequest.php** <?php namespace App\Talent\Employee\Requests; use Illuminate\Foundation\Http\FormRequest; class EmployeeCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { return [ 'first_name'=>'required|string', 'last_name'=>'required|string', 'email'=>'required|email|unique:employees,email', 'contact_number'=>'required|string', 'date_of_birth'=>'required|date', 'current_address'=>'required|string', 'pan_number'=>'string|nullable', 'bank_account_number'=>'string|nullable', 'avatar' => 'nullable|image|mimes:jpg,jpeg,png', 'documents'=>'required', 'documents.*'=>'max:5000|mimes:pdf,png,jpg,jpeg', ]; } public function messages() { return [ 'documents.max' => "Error uploading file:File too big.Max file size:5MB", ]; } } 员工迁移 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('employees', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->constrained('users')->restrictOnDelete(); $table->string('status'); $table->string('first_name'); $table->string('last_name'); $table->string('email')->unique(); $table->string('contact_number'); $table->date('date_of_birth'); $table->string('current_address'); $table->string('pan_number')->nullable(); $table->string('bank_account_number')->nullable(); $table->string('avatar')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('employees'); } }; 我正在尝试创建一个 API,将员工的个人详细信息存储到数据库中。在这里,图像字段是可选的,因此我在迁移和验证请求中也将头像字段设为可为空。但是,当我尝试将详细信息保存到数据库而不上传图像时,它显示未定义的头像。我不知道这里发生了什么,任何帮助或建议将非常感激。谢谢。 您正在使用字符串值 null 而不是关键字 null。

回答 1 投票 0

为什么用于 POST REQUEST 的标头不起作用,但使用 Auth 却可以工作? (WORDPRESS)

我正在尝试将数据库(SQLite)作为JSON文件发送并将其发布在Wordpress中(我也想编辑行和列等),但是当我这样做时,用python中的请求库做了一个简单的帖子

回答 1 投票 0

我如何在我的移动应用程序(flutter / dart)中使用metamask

我想使用元掩码创建一个移动应用程序,但是当我搜索这个想法时,我只找到了网络项目。那么我如何在我的移动应用程序中使用metamask钱包信息。有人从事这样的项目吗? ...

回答 1 投票 0

TypeORM 限制使用 createConnection(...) 创建的连接数

我需要帮助来限制 typeORM 在其连接管理器中可以保留的允许连接数。 今天我有很多数据库,超过12000个分布在一些服务器上,每个r...

回答 2 投票 0

无法在 Google AppScript 中获取 ElevenLabs API 来返回有效响应

我正在使用 Google AppScript 将 Eleven Labs 的 API 集成到工作表中。 试图通过这一步,以便我可以对返回的文件执行某些操作,但我无法通过此响应代码 422。我

回答 1 投票 0

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