Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
/ heweather-api-c Public archive

如何使用 C语言访问和风天气的数据接口,http + ssl

License

Notifications You must be signed in to change notification settings

xlofhappy/heweather-api-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

获取和风天气的天气数据

和风天气官网

https://www.heweather.com

和风天气接口文档

(实况数据)https://www.heweather.com/documents/api/s6/weather-now

和风天气城市搜索文档

https://www.heweather.com/documents/search/find

密钥

  1. 密钥存放在 example/http_req 中,可根据自己的密钥进行替换 key=xxxxxxxxxxxxxx
  2. 如果是按量计费或者付费用户,host 使用 api.heweather.net

编译

在代码目录中执行

make

运行

编译成功后,可执行文件名称为ssl_client

注意:若当前系统没有openssl动态库,需要先在代码顶级目录中执行如下命令,将lib目录添加到程序动态库的查找路径中

export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH

举例

下面命令向free-api.heweather.net发送HTTP请求,内容为example/http_req文件

./ssl_client free-api.heweather.net 443 example/http_req

About

如何使用 C语言访问和风天气的数据接口,http + ssl

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages