get-request 相关问题


Laravel POST 方法返回状态:405 不允许在 POST 方法上使用方法

请查找以下信息: NoteController.php 请查找以下信息: NoteController.php <?php namespace App\Http\Controllers; use App\Http\Requests\NoteRequest; use App\Models\Note; use Illuminate\Http\JsonResponse; class NoteController extends Controller { public function index():JsonResponse { $notes = Note::all(); return response()->json($notes, 200); } public function store(NoteRequest $request):JsonResponse { $note = Note::create( $request->all() ); return response()->json([ 'success' => true, 'data' => $note ], 201); } public function show($id):JsonResponse { $note = Note::find($id); return response()->json($note, 200); } public function update(NoteRequest $request, $id):JsonResponse { $note = Note::find($id); $note->update($request->all()); return response()->json([ 'success' => true, 'data' => $note, ], 200); } public function destroy($id):JsonResponse { Note::find($id)->delete(); return response()->json([ 'success' => true ], 200); } } NoteRequest.php <?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class NoteRequest extends FormRequest { public function authorize() { return true; } public function rules() { return [ 'title', 'required|max:255|min:3', 'content', 'nullable|max:255|min:10', ]; } } Note.php(模型) <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Note extends Model { use HasFactory; protected $guarded = []; } api.php <?php use App\Http\Controllers\NoteController; use Illuminate\Support\Facades\Route; Route::prefix('v1')->group(function () { Route::resource('/note', NoteController::class); }); php artisan 路线:列表 GET|HEAD / ...................................................................................................................... POST _ignition/execute-solution ............... ignition.executeSolution › Spatie\LaravelIgnition › ExecuteSolutionController GET|HEAD _ignition/health-check ........................... ignition.healthCheck › Spatie\LaravelIgnition › HealthCheckController POST _ignition/update-config ........................ ignition.updateConfig › Spatie\LaravelIgnition › UpdateConfigController GET|HEAD api/v1/note .......................................................................... note.index › NoteController@index POST api/v1/note .......................................................................... note.store › NoteController@store GET|HEAD api/v1/note/create ................................................................. note.create › NoteController@create GET|HEAD api/v1/note/{note} ..................................................................... note.show › NoteController@show PUT|PATCH api/v1/note/{note} ................................................................. note.update › NoteController@update DELETE api/v1/note/{note} ............................................................... note.destroy › NoteController@destroy GET|HEAD api/v1/note/{note}/edit ................................................................ note.edit › NoteController@edit GET|HEAD sanctum/csrf-cookie .................................. sanctum.csrf-cookie › Laravel\Sanctum › CsrfCookieController@show 迅雷请求(同邮递员) JSON 请求 { "title": "Hello World", "content": "Lorem ipsum." } 尝试发出 JSON POST 请求并获取状态:405 方法不允许并且我正在使用 php artisan 服务,如果需要,我可以提供 GIT 项目。请告诉我。 您的验证规则看起来不正确。在您的 NoteRequest 类中,规则应该是一个关联数组,其中键是字段名称,值是验证规则。但是,在您的代码中,规则被定义为以逗号分隔的字符串列表。这可能会导致验证失败并返回 405 Method Not allowed 错误。 public function rules() { return [ 'title' => 'required|max:255|min:3', 'content' => 'nullable|max:255|min:10', ]; }


如何使用 Microsoft Graph API 解决 Sharepoint(FileContentRead) 中的 404 -“ItemNotFound”错误?

我使用下面的 API 使用 Microsoft Graph API 从 Sharepoint 读取其内容。 https://graph.microsoft.com/v1.0/sites/{主机名},{spsite-id},{spweb-id}/drives//items/ 我使用下面的 API 使用 Microsoft Graph API 从 Sharepoint 读取其内容。 https://graph.microsoft.com/v1.0/sites/{hostname},{spsite-id},{spweb-id}/drives/<drive-id>/items/<items-id>/content 两天前,它正确地从根站点正确获取文件内容。但今天我检查了是否获得了与以下问题相同的文件内容。 { "error": { "code": "itemNotFound", "message": "Item not found", "innerError": { "request-id": "<request_id>", "date": "<date_time>" } } } 不知道这可能是什么原因造成的?我在谷歌上搜索没有找到更好的解决方案。 有人建议我解决上述问题的方法。 我建议使用此端点下载流式 DriveItem 内容: GET /sites/{siteId}/drive/items/{item-id}/content https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http


Laravel 8 中的非法运算符和值组合

为什么做超过7天总是出错? 公共函数分页(请求$请求) { $fromDate = $request->fromDate ? Carbon::parse($request->fromDate) : Carbon::now();...


移动设备友好测试 API 到 2024 年仍然有效吗?

我即将使用谷歌搜索控制台API从Mobile-FriendlyTest获取数据 $request = new Request('POST', 'https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run?key='.$


如何在构建器中传递 3 个 orderBy 方法?

在 laravel 10 站点上,我有具有不同数量的排序字段的 sql 请求,例如: $sortByField = $request->sortBy ?? 'ID'; $orderBy = $request->orderBy ?? '升序'; $sortByField...


在使用“POST”方法将数据存储到控制器之前查询$request结果

首先,我很抱歉,因为我是 Laravel 的新手。我想用 $request->id_anggota 作为“POST”方法的结果进行查询/雄辩,这样我就可以从另一个表格获取电子邮件属性...


passport-azure-ad / msal.js 和动态作用域

Azure AD v2.0 讨论了动态同意的优点之一 (https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/api-scopes#request-dynamic-scopes- for-增量-c...


Powershell 无效类错误

尝试运行powershell命令 获取 WmiObject win32_physicalmemory PS C:\> Get-WmiObject win32_physicalmemory Get-WmiObject:无效类“win32_physicalmemory” 在行:1 个字符:1...


刷新 AWS ECR 注册表的令牌

我有一个用于部署docker镜像的helm图表。我使用以下命令将秘密配置到 kubernetes 中: apt-get 安装 docker sudo apt-get install python python3-pip aws ecr get-login-password --region us-...


apt-get update 无法用作 azure 自定义脚本扩展

我正在使用带有自定义脚本扩展的 Azure ARM 模板部署 linux ubuntu 16.04 LTS VMSS。 customscript.sh的内容: apt-get 更新 apt-get install build-essential -y ... 但它失败了...


使用curl_cffi发出POST请求时出现400错误请求

我正在Python中使用curl_cffi库向URL https://www.midjourney.com/api/auth/signin/discord发出POST请求。但是,我遇到了“400 Bad Request”错误。我有


conda错误ssl证书:HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443

无论我做什么,我都会收到此错误 C:\Users\MyPc>conda update --all 解决环境:失败 CondaHTTPError:URL 的 HTTP 000 连接失败 无论我做什么,我都会收到此错误 C:\Users\MyPc>conda update --all Solving environment: failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/free/win-64/repodata.json.bz2> Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team. SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/free/win-64/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))')) 我已经搜索了所有互联网,重新安装了 anaconda 并做了建议中的任何操作,但这个问题仍然存在。 Windows 10 C:\Users\MyPc>anaconda --version anaconda 命令行客户端(版本 1.7.2) C:\Users\MyPc>conda --version 康达 4.5.12 就我而言,当我尝试运行此命令时,我收到了此类错误消息 conda install tensorflow 这是错误消息 CondaSSLError:OpenSSL 似乎在此计算机上不可用。下载并安装软件包需要 OpenSSL。 异常:HTTPSConnectionPool(主机='repo.anaconda.com',端口=443):超过最大重试次数,网址:/pkgs/main/win-64/current_repodata.json(由SSLError(“无法连接到HTTPS URL”)引起因为 SSL 模块不可用。")) 这就是解决方案 步骤01 进入你的anaconda3的安装路径 步骤02 现在转到此文件路径 anaconda3\Library\bin 步骤03 现在选择这个 DLL 文件并复制它 libcrypto-1_1-x64.dll libssl-1_1-x64.dll 步骤04 之后转到此文件路径并将其粘贴到该文件夹内部 anaconda3\DLLs 这个命令对我有用: conda config --set ssl_verify false 我也遇到了同样的问题,解决这个问题的方法是安装早期的 32 位版本的 Conda。由于某种原因,较新的 64 位版本似乎容易出现此错误。您可以在这里找到 Conda 的早期版本: https://repo.continuum.io/archive/ 您应该搜索仅具有 x86 而不是 x86_64 的 Anaconda3 版本。 我也遇到了同样的问题,简单的解决方案是: 从开始菜单打开anaconda navigator,然后运行CMD.exe提示符,然后从那里安装,就是这样。 在 C:\Users\xyz 目录中创建一个名为 .condarc 的文件,其中包含以下内容 频道: 默认值 ssl_verify:假 然后尝试创建虚拟环境: conda create -n envname python=x.x anaconda 祝你好运!


会话数据未跨请求保留 - Laravel/Inertia

我正在尝试在发布请求的会话中保存数据,然后重定向到另一个页面 尝试 { $tenant = 租户::where('email', '=', $request->input('email'))->firstOrFail(); } 抓住(


next.js 14 错误:无法读取未定义的属性(读取“get”)”

官方示例https://github.com/vercel/next.js/tree/canary/examples/next-forms在createTodo时出现错误“Error: Cannot readproperties of undefined (reading 'get')”。但是……


Demandware - 未找到当前域的管道

我已经做好了管道。效果很好。突然它给出了类似的错误 2015-12-18 02:39:08.091 GMT] 错误 system.core ISH-CORE-2368 Sites-SiteGenesis-Site core Storefront [uuid] [request-id...


访问Service中的请求范围Bean

我有一个常规bean,它是(a)@Scope(“request”)或(b)通过过滤器/拦截器放置在HttpServletRequest中。 如何在@Service 中访问这个bean,这是一种应用程序......


ImageMagick 扩展在此 PHP 安装中不可用

我正在使用 Laravel 10 和我的 PHP 版本 => 8.2.12。 我正在使用 Xampp 进行可能的项目。我无法解决此错误 if ($request->hasFile('product_images')) { // $productImageModel = 应用程序(


声明 MessageChannel beans 的首选方式

我在网上看到的大多数资源都是通过以下方式声明MessageChannels: @豆 消息通道 myChannel() { 返回新的 MessageChannels.direct().get(); } 看来 .get() 方法...


在Powershell中获取StdRegProv类

我能找到的在 Powershell 中获取 StdRegProv WMI 类实例的唯一方法是 $StdRegProv = Get-WmiObject -List -Namespace root\default -ComputerName "my_computer" -Credential $cred | $StdRegProv = Get-WmiObject -List -Namespace root\default -ComputerName "my_computer" -Credential $cred |什...


Get-PnPWebPart - 如何按照页面中使用的顺序获取 Web 部件

我正在使用 pnp 库来检索 Sharepoint 页面中使用的 Web 部件 Get-PnPWebPart -ServerRelativePageUrl“文件路径/test.aspx” 但 webpart 的顺序是


通过更少的 Java API 调用来映射 Google 云端硬盘内容的有效方法

大家好,我有一个代码,用于列出共享驱动器中存在的文件(以便稍后下载并创建相同的文件夹路径) 目前我做这样的事情: 哈希映射 大家好,我有一个代码,用于列出共享驱动器中存在的文件(以便稍后下载并创建相同的文件夹路径) 目前我正在做这样的事情: HashMap<String, Strin> foldersPathToID = new HashMap<>(); //searching all folders first saving their IDs searchAllFoldersRecursive(folderName.trim(), driveId, foldersPathToID); //then listing files in all folders HashMap<String, List<File>> pathFile = new HashMap<>(); for (Entry<String, String> pathFolder : foldersPathToID.entrySet()) { List<File> result = search(Type.FILE, pathFolder.getValue()); if (result.size() > 0) { String targetPathFolder = pathFolder.getKey().trim(); pathFile.putIfAbsent(targetPathFolder, new ArrayList<>()); for (File file : result) { pathFile.get(targetPathFolder).add(file); } } } 递归方法在哪里: private static void searchAllFoldersRecursive(String nameFold, String id, HashMap<String, String> map) throws IOException, RefreshTokenException { map.putIfAbsent(nameFold, id); List<File> result; result = search(Type.FOLDER, id); // dig deeper if (result.size() > 0) { for (File folder : result) { searchAllFoldersRecursive(nameFold + java.io.File.separator + normalizeName(folder.getName()), folder.getId(), map); } } } 搜索功能是: private static List<com.google.api.services.drive.model.File> search(Type type, String folderId) throws IOException, RefreshTokenException { String nextPageToken = "go"; List<File> driveFolders = new ArrayList<>(); com.google.api.services.drive.Drive.Files.List request = service.files() .list() .setQ("'" + folderId + "' in parents and mimeType" + (type == Type.FOLDER ? "=" : "!=") + "'application/vnd.google-apps.folder' and trashed = false") .setPageSize(100).setFields("nextPageToken, files(id, name)"); while (nextPageToken != null && nextPageToken.length() > 0) { try { FileList result = request.execute(); driveFolders.addAll(result.getFiles()); nextPageToken = result.getNextPageToken(); request.setPageToken(nextPageToken); return driveFolders; } catch (TokenResponseException tokenError) { if (tokenError.getDetails().getError().equalsIgnoreCase("invalid_grant")) { log.err("Token no more valid removing it Please retry"); java.io.File cred = new java.io.File("./tokens/StoredCredential"); if (cred.exists()) { cred.delete(); } throw new RefreshTokenException("Creds invalid will retry re allow for the token"); } log.err("Error while geting response with token for folder id : " + folderId, tokenError); nextPageToken = null; } catch (Exception e) { log.err("Error while reading folder id : " + folderId, e); nextPageToken = null; } } return new ArrayList<>(); } 我确信有一种方法可以通过很少的 api 调用(甚至可能是一个调用?)对每个文件(使用文件夹树路径)进行正确的映射,因为在我的版本中,我花了很多时间进行调用 service.files().list().setQ("'" + folderId+ "' in parents and mimeType" + (type == Type.FOLDER ? "=" : "!=") + "'application/vnd.google-apps.folder' and trashed = false").setPageSize(100).setFields("nextPageToken, files(id, name)"); 每个子文件夹至少一次......并且递归搜索所有内容需要很长时间。最后,映射比下载本身花费的时间更多...... 我搜索了文档,也在此处搜索,但没有找到任何内容来列出具有一个库的所有驱动器调用任何想法? 我想使用专用的 java API 来获取共享 GoogleDrive 中的所有文件及其相对路径,但调用次数尽可能少。 提前感谢您的时间和答复 我建议您使用高效的数据结构和逻辑来构建文件夹树并将文件映射到其路径,如下所示 private static void mapDriveContent(String driveId) throws IOException { // HashMap to store folder ID to path mapping HashMap<String, String> idToPath = new HashMap<>(); // HashMap to store files based on their paths HashMap<String, List<File>> pathToFile = new HashMap<>(); // Fetch all files and folders in the drive List<File> allFiles = fetchAllFiles(driveId); // Build folder path mapping and organize files for (File file : allFiles) { String parentId = (file.getParents() != null && !file.getParents().isEmpty()) ? file.getParents().get(0) : null; String path = buildPath(file, parentId, idToPath); if (file.getMimeType().equals("application/vnd.google-apps.folder")) { idToPath.put(file.getId(), path); } else { pathToFile.computeIfAbsent(path, k -> new ArrayList<>()).add(file); } } // Now, pathToFile contains the mapping of paths to files // Your logic to handle these files goes here } private static List<File> fetchAllFiles(String driveId) throws IOException { // Implement fetching all files and folders here // Make sure to handle pagination if necessary // ... } private static String buildPath(File file, String parentId, HashMap<String, String> idToPath) { // Build the file path based on its parent ID and the idToPath mapping // ... }


GET 请求时 TLS 初始化失败

我从qt/c++开始,在我的项目中我需要制作一个json post/get/put,但我试图做一个简单的获取请求,但我有一个错误:qt.network.ssl: QSslSocket ::connectToHostEncrypted:TLS


API .net core with list 如何在任务<IActionResult> Post([FromBody] List<T>? request) 不是列表或数组时显示 badrequest 自定义消息?

问题在于我有这篇文章: 公共异步任务 Post([FromBody]列表?请求) 但是当你在 Postman 中尝试使用没有 [] 的错误时......


华为 E3372h-320 hilink USSD /api/ussd/get 和 /api/ussd/send 错误

我正在尝试发送 USSD 并开始工作,但出现如下错误。 ussd/send(错误111016)和ussd/get(125003)。您能告诉我哪里可能出错吗? 脚本 #!/b...


Ignite Rest Api - 增量方法

无法获取增量值,当我执行 get 操作时,我得到的是我最初放置的值,而不是增量后的值 你好, 我无法获得增量值,当我执行 get 时,我得到 v...


通过Angular到Springboot访问POST失败但GET成功,Postman适用于GET和POST

我正在使用示例 Angular 应用程序来测试 Okta 与 springboot 应用程序的集成。 前端示例:https://github.com/okta-samples/okta-angular-sample 我有一个带有


如何取消查看/切换 GitHub Pull Request 上所有已查看的文件?

我知道我可以手动转到 PR 并取消选中“已查看”。是否有取消选中 PR 中所有文件的快捷方式? 在GitHub上发现了一些相关问题 https://github.com/refined-github/refined-github/issues/


NLog 在ConfigureServices 中写入日志会导致日志在整个应用程序中丢失${aspnet-request-url} 和${aspnet-mvc-action}

我使用 NLog 在我的 Web API 应用程序上写入日志(.Net 6) 我需要写入ConfigureServices 方法内的日志。 由于此时ILogger还无法使用,所以我就用这种方式来写...


在 Docker 中的 Ubuntu 上安装最新版本 Node (v20) 的说明不起作用?

我只是按照说明在 Ubuntu 上的 docker 中安装了最新版本的 Node (v20),在我的 Dockerfile 中包含以下内容: 来自 --platform=linux/amd64 ubuntu:22.04 运行 apt-get update 运行 apt-get...


Flutter Web 应用程序在发送带有 body 的 GET 请求时遇到错误

我目前正在开发一个 Flutter Web 应用程序,在尝试发送带有正文的 GET 请求时遇到了一个问题。该应用程序在 Chrome 上按预期运行,但是...


在安装新版本操作之前无法创建'./usr/bin/ssh'的备份链接

最近我的实验室ubuntu服务器遇到了一个麻烦的问题。我想重新安装 openssh 服务器,所以我运行命令 sudo apt-get 安装 openssh-client sudo apt-get 安装 openssh-server


Laravel Cashier Stripe 错误default_ payment_method

我需要进行用户订阅Stripe。我使用支付页面: 公共函数 paymentForm() { $id = equest()->get('id'); $plan = Plan::find(1); $intent = auth()->user()->


需要什么才能使图请求成功?

在 GET 请求上: https://graph.microsoft.com/v1.0/users/me/joinedTeams 从以下位置检索 accesstoken:https://login.microsoftonline.com/4c3a1b30-xxxx-xxxx-9581-0281c4427992/oauth2/token 我是


如何通过对 18k 邮箱进行格式化来加速 PowerShell 脚本提取 Get-EXOMailbox 和 Get-EXOMailboxStatistics 信息

我是一名 PowerShell 初学者用户,我编写了一个脚本来提取有关我的组织(大约 18,000 个用户)中每个用户的邮箱和存档的特定信息。目前大约需要24...


Get-AzVMImage 不输出 PSVirtualMachineImageDetail

我试图从天蓝色的虚拟机映像中获取详细信息,但该信息似乎不存在。 $location =“瑞典中央” $publisher = "MicrosoftSQLServer" #G...


NVMe S.M.A.R.T.数据检索

我开发了一个程序,能够在 WMI 的帮助下检索 SATA 设备的智能数据,如下所示: Get-WmiObject -命名空间“Root\WMI”-类“MSStorageDriver_ATAPISMartData”|塞勒...


Spring Boot中无法通过GET方法获取图像?

这是我的实体类 @ToString @数据 @实体 公开课产品{ @ID @GenerateValue(策略 = GenerationType.IDENTITY) 私有 int id; 私有字符串名称; 私人


如何检测Rust Rocket_ws客户端与WebSocket断开连接

从rocket_ws文档(https://api.rocket.rs/v0.5/rocket_ws/)我知道我可以使用这段代码与客户端建立websocket连接: #[get("/echo?channel")] fn echo_ch...


为什么在某种场景下要使用await

如果我有一个 GET 请求,只是从数据库返回一些内容,我应该这样做: 返回 _dbContext.MyTable.Where(...).ToList(); 或者: 返回等待_dbContext.MyTable.Where(...)。


如何在Ubuntu上安装Xdebug?

我正在尝试在 Ubuntu 上安装 xdebug: sudo apt-get install php-xdebug 并出现以下错误: 需要获取 806 kB 的档案。此操作后,4.423 kB 额外的磁盘空间...


升级到micronaut 4后Micronaut消费和生产停止工作

在 micronaut 版本 3 上,它工作正常,在迁移到 micronaut 4 时,停止工作 在注释有的端点中 @Get("/{someId}/someAction", 产生 = ["application/some.v1+json&


如何修复“ConnectionString 属性尚未初始化。”在.Net

我正在使用 Docker 容器开发一个 .Net api,但目前在 swagger 中请求 GET 请求时,它会返回“ConnectionString 属性尚未初始化”。其中有...


通过powershell触发azure操作组

我可以使用 Get-AzActionGroup 命令检索我的操作组。但我想通过我的 Runbook 使用 powershell 命令激活/触发/触发该操作组。这有可能吗?还有...


服务器返回“405 Method Not allowed”。仅限一条路线

主页的web.php中的这条路线 路线::get('/', 'App\Http\Controllers\IndexController@index'); 如果我运行 php artisan optimize 或 artisan route:cache,页面会变成错误 405 哎呀!错误


Powershell 确定它是 Active Directory 中的用户还是组

我正在尝试为 Get-LocalGroupMember 问题创建一个解决方法,如下所述: https://github.com/PowerShell/PowerShell/issues/2996 读完之后,我想出了这个函数来...


在android中的服务中访问viewModel

我们如何在服务中初始化viewModel。 在片段中,我们使用 Kotlin 委托“by ActivityViewModels”来完成此操作。 或者我们可以使用 ViewModelProvider().get 来完成。 但据我...


替换R函数中变量名的多个实例并保存修改后的函数

上下文 考虑以下愚蠢的 MWE: 老有趣<- function(x) { VarA <- sum(x) VarA <- 2 * VarA VarX <- VarA %% 2 } I want to replace VarA with VarB and VarX VarY to get: new...


Powershell cmdlet Get-WinEvent 导致内存泄漏

我正在编写一个简单的 Powershell 脚本来将 Windows EventLogs 转发到外部 Syslog 服务器 - 该脚本应该作为服务持续运行。为了获得前夕的事件...


无法通过PAT令牌调用Azure DevOps Rest Api

我正在尝试使用 Azure DevOps Rest api 将保存在本地目录(桌面)中的 json 文件导入到 Azure DevOps 库变量组。 这是剧本。 $jsonbody = Get-Content -Path "C: ar...


在 Stripe 结帐会话中集成自定义税费和折扣

您能帮我将税收和折扣整合到我的 Stripe sission 中吗 这是我当前的代码 类 CreateCheckoutSessionOrderView(视图): def get(自身, 请求, *args, **kwargs): 或者...


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