api 相关问题

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

错误:String类型不是Map String类型的子类型,动态

出现错误:String 类型不是 Map String 类型的子类型,动态 导入 'package:ajooyo/features/products/models/product_model.dart'; 类购物车项目{ 最终产品; 最后的int qu...

回答 2 投票 0

JPA 存储库返回多对多策略的雇员列表

我有: @实体 @Table(姓名=“员工”) 数据类员工( @ID @Column(名称=“id”) @GenerateValue(策略 = GenerationType.IDENTITY) 有效 ID:整数? = 空, @Column(名称 = &...

回答 1 投票 0

与 Azure Graph API 交互时在 Python 中处理分页

我使用 Azure Graph 查询获取租户中的所有资源组标签,该查询使用门户中的 Azure 图形资源管理器可以完美运行。 这是查询: 资源容器 |哪里...

回答 1 投票 0

以安全且运行时可编辑的方式存储 API 密钥....?

我目前正在从事节点项目。我的应用程序与另一个应用程序的 API 进行通信以获取或上传数据。每个请求都必须有一个密钥才能通过...

回答 1 投票 0

Python POST 到 API 请求问题

我一直致力于在 Python 3.10.10 上使用 pytest 进行 API 测试,并且我偶然发现了一个 post 请求的问题。这是我目前拥有的代码: 将请求导入为 req api = '一些api' ...

回答 2 投票 0

YTSearchbar 术语连接到搜索栏

我是反应初学者。当我制作自己的 YouTube 应用程序时,我想将 YTSearchbar 术语连接到我的应用程序上的搜索栏。 这里 从 'react' 导入 React, { Component }; 导入 ReactDOM...

回答 1 投票 0

如何正确处理 api 路由 Next JS 14 中抛出的错误?

当某些用户尝试使用已注册的电子邮件进行注册时,我想显示漂亮的用户界面消息。 这是我的route.tsx(/api/auth/register/route.tsx) 从“next/server&qu...”导入 { NextResponse }

回答 1 投票 0

如何在`npm run build`之后更改API中的端口

客户/ 脚本使得ApiCall/ 等待 axios.get("http://localhost:${REACT_PORT}/api/product-category"); 执行“npm run build”。 REACT_PORT 值被烘焙到构建中。

回答 1 投票 0

Spotify API 客户端密钥无效

我正在尝试为 Spotify 进行 api 调用,但现在无法正常工作。从 Oauth2 我认为我们不应该传递客户端秘密,但我有这个错误 (底座)ivoryle@dyn234000 象牙...

回答 1 投票 0

Kubernetes Javascript 客户端库适用于本地,但不适用于 GKE

我正在尝试使用 Kubernetes JS 客户端库,当我在本地环境中尝试它时(我使用 docker 来运行本地 kubernetes),它工作正常,我正在创建一个用于测试目的的 pod。 .

回答 2 投票 0

有没有办法利用YouTube的API通过文字记录批量搜索所有视频?

我正在制作一部纪录片并寻找特定的原声片段 - 想知道是否有人开发出一种方法来集体搜索 YouTube 记录。 举个例子:如果我正在寻找一个 cl...

回答 2 投票 0

WordPress REST API:无法上传内容类型图像/jpeg

WordPress REST API 显然不允许我上传内容类型为“image/jpeg”的文件。 如果我将内容类型设置为空字符串,我就可以创建媒体项目并上传附加文件(...

回答 2 投票 0

我想使用 API 向我的 Facebook 页面添加评论

我想使用 API 添加评论到我的 FACEBOOK 和 INSTAGRAM 页面。 有人有更多这方面的信息吗? 我阅读了元 API 文档,但没有找到任何相关内容。 注意:我想整合...

回答 1 投票 0

从子屏向父屏传递数据时出现颤动错误(执行订单)

首先对英语的混乱感到抱歉,因为它不是我的母语。 所以我正在尝试构建一个汽车租赁应用程序,该应用程序在 flutter 中使用来自 google 的地图 api,我基本上有一个按钮可以获取

回答 1 投票 0

莱昂纳多人工智能Python

也许有人知道如何使用DramShaper V7在Python中的Leonardo AI中创建照片并返回图像链接'? 我只看到如何获取 id,我需要 URL,但我没有找到 dreamsha...

回答 1 投票 0

我正在尝试在 Laravel 中创建 API,但遇到问题

我正在尝试在Laravel中创建一个API,Laravel中的routes文件夹中有api.php文件吗?还是必须手动完成?因为当我创建它时该文件没有出现 我试过看...

回答 1 投票 0

我想在我的网站中包含来自weatherOpenMap的API以显示基于此的天气动态图标,但它没有显示

我将其包含在我的 html 标头中: 这是我的天气部分: <... I included this in my html header : <script src="main.js"></script> and this is in my weather section : <div class="weatherIcon"> <h2><span id="weather-icon">weather icon...</span></h2> </div> and this is in my javascript file (main.js) : const getWeather = async () => { try { const response = await fetch('https://api.openweathermap.org/data/2.5/weather?q=gothenburg,se&APPID=c95f90301395e8ce1cb18d910cd184cb'); const data = await response.json(); const weatherCondition = data.weather[0].id; const weatherIcon = getWeatherIcon(weatherCondition); document.getElementById('weather-icon').innerHTML = weatherIcon; } catch (error) { console.log('Error fetching weather data:',error); } }; // Function to get the appropriate weather icon based on the weather condition code const getWeatherIcon = (weatherCondition) => { if (weatherCondition >= 200 && weatherCondition < 300) { return '<i class="wi wi-thunderstorm weather-icon"></i>'; // Thunderstorm } else if (weatherCondition >= 300 && weatherCondition < 400) { return '<i class="wi wi-rain weather-icon"></i>'; // Drizzle } else if (weatherCondition >= 500 && weatherCondition < 600) { return '<i class="wi wi-day-rain weather-icon"></i>'; // Rain } else if (weatherCondition >= 600 && weatherCondition < 700) { return '<i class="wi wi-day-snow weather-icon"></i>'; // Snow } else if (weatherCondition >= 700 && weatherCondition < 800) { return '<i class="wi wi-fog weather-icon"></i>'; // Atmosphere } else if (weatherCondition === 800) { return '<i class="wi wi-day-sunny weather-icon"></i>'; // Clear } else if (weatherCondition > 800) { return '<i class="wi wi-day-cloudy weather-icon"></i>'; // Clouds } else { return ''; } }; // Call the getWeather function to fetch weather data and display the icon getWeather(); and this is in style.css : .weatherIcon { font-size: 2em; } 现在,当我在浏览器中打开我的index.html时,它会显示文本(天气图标...),所以我猜测文件已正确连接。当我在浏览器中搜索 API 时,它给了我一个数据,所以我不知道问题是什么,有人知道吗?预先感谢 我认为您的 HTML 中缺少 weather-icon 样式。 所有其他代码都可以。 index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Weather Icon Display</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.12/css/weather-icons.min.css"> <style> .weatherIcon { font-size: 2em; text-align: center; margin-top: 20px; color: #0056b3; } .weatherIcon i { color: #00468b; text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5); } </style> </head> <body> <div class="weatherIcon"> <h2><span id="weather-icon">weather icon...</span></h2> </div> <script src="main.js"></script> </body> </html> main.js const getWeather = async () => { try { const response = await fetch('https://api.openweathermap.org/data/2.5/weather?q=gothenburg,se&APPID=c95f90301395e8ce1cb18d910cd184cb'); const data = await response.json(); const weatherCondition = data.weather[0].id; const weatherIcon = getWeatherIcon(weatherCondition); document.getElementById('weather-icon').innerHTML = weatherIcon; } catch (error) { console.log('Error fetching weather data:',error); document.getElementById('weather-icon').innerHTML = '<i class="wi wi-na"></i>'; // Default icon on error } }; // Function to get the appropriate weather icon based on the weather condition code const getWeatherIcon = (weatherCondition) => { if (weatherCondition >= 200 && weatherCondition < 300) { return '<i class="wi wi-thunderstorm weather-icon"></i>'; // Thunderstorm } else if (weatherCondition >= 300 && weatherCondition < 400) { return '<i class="wi wi-rain weather-icon"></i>'; // Drizzle } else if (weatherCondition >= 500 && weatherCondition < 600) { return '<i class="wi wi-day-rain weather-icon"></i>'; // Rain } else if (weatherCondition >= 600 && weatherCondition < 700) { return '<i class="wi wi-day-snow weather-icon"></i>'; // Snow } else if (weatherCondition >= 700 && weatherCondition < 800) { return '<i class="wi wi-fog weather-icon"></i>'; // Atmosphere } else if (weatherCondition === 800) { return '<i class="wi wi-day-sunny weather-icon"></i>'; // Clear } else if (weatherCondition > 800) { return '<i class="wi wi-day-cloudy weather-icon"></i>'; // Clouds } else { return ''; } }; // Call the getWeather function to fetch weather data and display the icon getWeather(); 结果

回答 1 投票 0

当用户在 Angular 11+ 中单击“重试”时如何调用相同的 API?

当 api 需要超过 30 秒才能给出响应时,我想停止加载程序并简单地在页面上显示“重试”按钮。 当用户单击该按钮时,我想调用相同的 API。 这整个专业...

回答 1 投票 0

处理 Scopus400pybliometrics 错误:超出最大查询限制

我正在使用 pybliometrics 库,使用复杂的查询在 Scopus 数据库中搜索一系列出版年份。但是,当我运行脚本时,我遇到了 Scopus400Error s...

回答 1 投票 0

从 Visual Basic 调用 REST API

我不断收到 404 错误。 如果我从 SoapUI 调用 REST API,效果很好。 我使用的是 Visual Basic VS2015。 我有一个示例函数,我从一个简单的表单项目中调用它。这只是为了...

回答 1 投票 0

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