一个人做的网站做什么好/重庆seo哪个强
0 WinHttp.WinHttpRequest简介
winhttp.winhttprequest是Windows操作系统中的一个API函数,用于创建和发送HTTP请求。它可以用于从Web服务器获取数据,或将数据发送到Web服务器。该函数提供了许多选项,例如设置请求头、设置代理服务器、设置超时时间等。它是一个非常强大的工具,可以帮助开发人员轻松地与Web服务器进行通信。
winhttp.winhttprequest.5.1
wihttp.winhttprequest.5.1是一个Microsoft Windows操作系统中的COM组件,用于在应用程序中进行HTTP请求和响应。它提供了一种简单的方法来与Web服务器进行通信,可以用于发送和接收HTTP请求和响应,支持各种HTTP方法,如GET、POST、PUT、DELETE等。它还提供了一些其他功能,如设置请求头、设置代理服务器、设置超时等。
1 创建PB窗口
为了演示winhttp.winhttprequest的使用创建一PB测试窗口w_restful如下:
窗口w_restful代码如下:
forward
global type w_restful from window
end type
type mle_resp from multilineedit within w_restful
end type
type st_3 from statictext within w_restful
end type
type cb_delete from commandbutton within w_restful
end type
type cb_put from commandbutton within w_restful
end type
type cb_post from commandbutton within w_restful
end type
type cb_get from commandbutton within w_restful
end type
type sle_data from singlelineedit within w_restful
end type
type sle_url from singlelineedit within w_restful
end type
type st_2 from statictext within w_restful
end type
type st_1 from statictext within w_restful
end type
end forwardglobal type w_restful from window
integer width = 3186
integer height = 1980
boolean titlebar = true
string title = "PB请求RESTful的数据"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
mle_resp mle_resp
st_3 st_3
cb_delete cb_delete
cb_put cb_put
cb_post cb_post
cb_get cb_get
sle_data sle_data
sle_url sle_url
st_2 st_2
st_1 st_1
end type
global w_restful w_restfulforward prototypes
public subroutine wf_https (string as_method)
end prototypespublic subroutine wf_https (string as_method);string ls_url,ls_data
ls_url = sle_url.text
ls_data = sle_data.textstring ls_ret ls_ret = gf_https_apex(ls_url,ls_data,as_method)mle_resp.text = ls_ret
end subroutineon w_restful.create
this.mle_resp=create mle_resp
this.st_3=create st_3
this.cb_delete=create cb_delete
this.cb_put=create cb_put
this.cb_post=create cb_post
this.cb_get=create cb_get
this.sle_data=create sle_data
this.sle_url=create sle_url
this.st_2=create st_2
this.st_1=create st_1
this.Control[]={this.mle_resp,&
this.st_3,&
this.cb_delete,&
this.cb_put,&
this.cb_post,&
this.cb_get,&
this.sle_data,&
this.sle_url,&
this.st_2,&
this.st_1}
end onon w_restful.destroy
destroy(this.mle_resp)
destroy(this.st_3)
destroy(this.cb_delete)
destroy(this.cb_put)
destroy(this.cb_post)
destroy(this.cb_get)
destroy(this.sle_data)
destroy(this.sle_url)
destroy(this.st_2)
destroy(this.st_1)
end onevent resize;//窗口控件自动适用long llw , llh
llw = this.workspacewidth( ) - sle_url.x llh = this.workspaceheight( ) - mle_resp.ysle_url.width = llwsle_data.width = llwmle_resp.width = llw
mle_resp.height = llh
end eventtype mle_resp from multilineedit within w_restful
integer x = 411
integer y = 248
integer width = 2158
integer height = 812
integer taborder = 40
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
string text = "responseText"
borderstyle borderstyle = stylelowered!
end typetype st_3 from statictext within w_restful
integer x = 78
integer y = 256
integer width = 302
integer height = 76
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Response:"
alignment alignment = Right!
boolean focusrectangle = false
end typetype cb_delete from commandbutton within w_restful
integer x = 14
integer y = 784
integer width = 375
integer height = 116
integer taborder = 60
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "DELETE"
end typeevent clicked;//DELETE
wf_https("DELETE")
end eventtype cb_put from commandbutton within w_restful
integer x = 14
integer y = 648
integer width = 375
integer height = 116
integer taborder = 50
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "PUT"
end typeevent clicked;//PUT
wf_https("PUT")
end eventtype cb_post from commandbutton within w_restful
integer x = 14
integer y = 512
integer width = 375
integer height = 116
integer taborder = 40
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "POST"
end typeevent clicked;//POST
wf_https("POST")
end eventtype cb_get from commandbutton within w_restful
integer x = 14
integer y = 376
integer width = 375
integer height = 116
integer taborder = 30
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "GET"
end typeevent clicked;//GET
wf_https("GET")
end eventtype sle_data from singlelineedit within w_restful
integer x = 411
integer y = 128
integer width = 2167
integer height = 100
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
string text = "{}"
borderstyle borderstyle = stylelowered!
end typetype sle_url from singlelineedit within w_restful
integer x = 411
integer y = 4
integer width = 2167
integer height = 100
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
string text = "https://apex.oracle.com/pls/apex/blma/b5217/"
borderstyle borderstyle = stylelowered!
end typetype st_2 from statictext within w_restful
integer x = 137
integer y = 136
integer width = 242
integer height = 76
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "DATA:"
alignment alignment = Right!
boolean focusrectangle = false
end typetype st_1 from statictext within w_restful
integer x = 137
integer y = 28
integer width = 242
integer height = 76
integer textsize = -9
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "URL:"
alignment alignment = Right!
boolean focusrectangle = false
end type
2 创建全局函数gf_https_apex()
用来发送请求和获得响应
global type gf_https_apex from function_object
end typeforward prototypes
global function string gf_https_apex (string as_url, string as_data, string as_method)
end prototypesglobal function string gf_https_apex (string as_url, string as_data, string as_method);// 用WinHttp.WinHttpRequest.5.1组件,请求https网页和响应/* 调用参数示例
String ls_url,ls_data,ls_response
ls_url = 'https://datacenter-web.eastmoney.com/api/data/v1/get?'
ls_data = "callback=jQuery11230903969942572268_1651624511350&sortColumns=UPDATE_DATE,SECURITY_CODE&sortTypes=-1,-1&pageSize=50&pageNumber=1&reportName=RPT_LICO_FN_CPD&columns=ALL&filter=(REPORTDATE='2023-09-30')"
ls_response = gf_https_apex(ls_url,ls_data,ls_method)
*/String ls_url,ls_data,ls_response//请求的URL和数据
ls_url = as_url
ls_data = as_dataOleObject lole_https //声明ole
lole_https = CREATE oleobject long llr
any la
llr = lole_https.ConnectToNewObject("WinHttp.WinHttpRequest.5.1")
lole_https.setTimeouts (50000,50000,50000,10000)
la = lole_https.open (as_method,ls_url, false) //OPEN if not upper(as_method) = "DELETE" then lole_https.setRequestHeader ("Content-Type", "application/json")lole_https.setRequestHeader ('Content-Length',string(len(ls_data)))
end iflole_https.setRequestHeader ("charset","UTF-8")
lole_https.setRequestHeader ("User-Agent","Mozilla/5.0") //这个是Apex的RESTful需要的lole_https.Send(ls_data)
/*
关键是这一步:如果你的https的环境没有安装浏览器的认证的根证书,一定会报错退出,
如果你申请安装了verisign等权威机构发的根证书,用ie打开上面的https,就不会报红色警告(问你是不是继续)。
但pb不会提示你是不是继续,直接报错退出。verisign的证书一年好像要1万-10万元的服务费。在这里你如果想测试一下,
你可以把上面的https地址换成https://www.alipay.com/ (支付宝的),不会报错的。注意:这里的证书及验证都是单向验证,不是双向的。
*/IF lole_https.Status >= 300 THEN ls_response = string(lole_https.Status) + " : " + string(lole_https.StatusText)MessageBox ("HTTPs request failed:",ls_response ) return ls_response
END IF blob lb_body
lb_body = lole_https.responseBodyls_response = string(lb_body,EncodingUTF8!) //返回结果//销毁 ole
destroy lole_httpsreturn ls_responseend function
3 运行效果
窗口上的调用https请求的函数代码:
string ls_url,ls_data
ls_url = sle_url.text
ls_data = sle_data.textstring ls_ret ls_ret = gf_https_apex(ls_url,ls_data,as_method)mle_resp.text = ls_ret
3.1 GET请求数据
【GET】按钮上的代码:
//GET
wf_https("GET")
数据库表上的数据:
3.2 POST添加数据
【POST】按钮上的代码:
//POST
wf_https("POST")
3.3 PUT修改数据
【PUT】按钮上的代码:
//PUT
wf_https("PUT")
3.4 DELETE删除数据
【DELETE】按钮上的代码:
//DELETE
wf_https("DELETE")
4 Apex的AutoREST的其它服务
- GET一条记录
- GET分页设置
- 查询条件GET数据
- 按查询条件DELETE数据
- 批量从本地文件加载数据
- 等等,不再举例演示了
相关文章:

【PB续命05】WinHttp.WinHttpRequest的介绍与使用
0 WinHttp.WinHttpRequest简介 winhttp.winhttprequest是Windows操作系统中的一个API函数,用于创建和发送HTTP请求。它可以用于从Web服务器获取数据,或将数据发送到Web服务器。该函数提供了许多选项,例如设置请求头、设置代理服务器、设置超…...

【Linux】进程间是这样通信的--管道篇
TOC 目录 进程间通信的介绍 进程间通信的概念 进程间通信的目的 进程间通信的本质 进程间通信的分类 管道 什么是管道 匿名管道 pipe函数 匿名管道使用步骤 管道读写规则 管道的特点 1、管道内部自带同步与互斥机制 2、管道的生命周期随进程 3、管道提供的是流式…...

Python基础入门例程60-NP60 跳过列表的某个元素(循环语句)
最近的博文: Python基础入门例程59-NP59 提前结束的循环(循环语句)-CSDN博客 Python基础入门例程58-NP58 找到HR(循环语句)-CSDN博客 Python基础入门例程57-NP57 格式化清单(循环语句)-CSDN博客 目录 最近的博文: 描述...

三十二、W5100S/W5500+RP2040树莓派Pico<UPnP示例>
文章目录 1 前言2 简介2 .1 什么是UPnP?2.2 UPnP的优点2.3 UPnP数据交互原理2.4 UPnP应用场景 3 WIZnet以太网芯片4 UPnP示例概述以及使用4.1 流程图4.2 准备工作核心4.3 连接方式4.4 主要代码概述4.5 结果演示 5 注意事项6 相关链接 1 前言 随着智能家居、物联网等…...

2023.11.18 Hadoop之 YARN
1.简介 Apache Hadoop YARN (Yet Another Resource Negotiator,另一种资源协调者)是一种新的 Hadoop 资源管理器,它是一个通用资源管理系统和调度平台,可为上层应用提供统一的资源管理和调度。支持多个数据处理框架&…...

ceph 常用命令
bucket 常用命令 查看 realm (区域) radosgw-admin realm list输出 {"default_info": "43c462f5-5634-496e-ad4e-978d28c2x9090","realms": ["myrgw"] }radosgw-admin realm get{"id": "2cfc…...

6.8完全二叉树的节点个数(LC222-E)
算法: 如果不考虑完全二叉树的特性,直接把完全二叉树当作普通二叉树求节点数,其实也很简单。 递归法: 用什么顺序遍历都可以。 比如后序遍历(LRV):不断遍历左右子树的节点数,最后…...

基于协作mimo系统的RM编译码误码率matlab仿真,对比硬判决译码和软判决译码
目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 5.算法完整程序工程 1.算法运行效果图预览 2.算法运行软件版本 matlab2022a 3.部分核心程序 ..................................................................... while(Err < TL…...

Django模型层
模型层 与数据库相关的,用于定义数据模型和数据库表结构。 在Django应用程序中,模型层是数据库和应用程序之间的接口,它负责处理所有与数据库相关的操作,例如创建、读取、更新和删除记录。Django的模型层还提供了一些高级功能 首…...

计算机视觉的应用18-一键抠图人像与更换背景的项目应用,可扩展批量抠图与背景替换
大家好,我是微学AI,今天给大家介绍一下计算机视觉的应用18-一键抠图人像与更换背景的项目应用,可扩展批量抠图与背景替换。该项目能够让你轻松地处理和编辑图片。这个项目的核心功能是一键抠图和更换背景。这个项目能够自动识别图片中的主体&…...

Redis(哈希Hash和发布订阅模式)
哈希是一个字符类型字段和值的映射表。 在Redis中,哈希是一种数据结构,用于存储键值对的集合。哈希可以理解为一个键值对的集合,其中每个键都对应一个值。哈希在Redis中的作用主要有以下几点: 1. 存储对象:哈希可以用…...

php正则表达式汇总
php正则表达式有"/pattern/“、”“、”$“、”.“、”[]“、”[]“、”[a-z]“、”[A-Z]“、”[0-9]“、”\d"、“\D”、“\w”、“\W”、“\s”、“\S”、“\b”、“*”、“”、“?”、“{n}”、“{n,}”、“{n,m}”、“\bword\b”、“(pattern)”、“x|y"和…...

Python与ArcGIS系列(八)通过python执行地理处理工具
目录 0 简述1 脚本执行地理处理工具2 在地理处理工具间建立联系0 简述 arcgis包含数百种可以通过python脚本执行的地理处理工具,这样就通过python可以处理复杂的工作和批处理。本篇将介绍如何利用arcpy实现执行地理处理工具以及在地理处理工具间建立联系。 1 脚本执行地理处理…...

cocos----刚体
刚体(Rigidbody) 刚体(Rigidbody)是运动学(Kinematic)中的一个概念,指在运动中和受力作用后,形状和大小不变,而且内部各点的相对位置不变的物体。在 Unity3D 中ÿ…...

【SAP-HCM】--HR人员信息导入函数
人员基本信息导入函数:HR_MAINTAIN_MASTERDATA 人员其他信息类型导入函数:HR_INFOTYPE_OPERATION 不逼逼,直接上代码,这两个函数还是相对简单易懂的 *根据操作类型查找对应的T529A 操作类型对应的值IF gt_alv IS NOT INITIAL.S…...

【开源】基于JAVA的大学兼职教师管理系统
项目编号: S 004 ,文末获取源码。 \color{red}{项目编号:S004,文末获取源码。} 项目编号:S004,文末获取源码。 目录 一、摘要1.1 项目介绍1.2 项目录屏 二、研究内容三、界面展示3.1 登录注册3.2 学生教师管…...

Pyhon函数
import time # # for i in range(1,10): # j1 # for j in range(1,i1): # print(f"{i}x{j}{i*j} " ,end) # print() #复用,代码,精简,复用度高def j99(n1,max10): for i in range(n,max):jifor j in ran…...

使用vuex完成小黑记事本案例
使用vuex完成小黑记事本案例 App.vue <template><div id"app"><TodoHeader></TodoHeader><TodoMain ></TodoMain><TodoFooter></TodoFooter></div> </template><script> import TodoMain from …...

进阶理解:leetcode115.不同的子序列(细节深度)
这道题是困难题,本章是针对于动态规划解决,对于思路进行一个全面透彻的讲解,但是并不是对于基础讲解思路,而是渗透到递推式和dp填数的详解,如果有读者不清楚基本的解题思路,请看我的这篇文章算法训练营DAY5…...

数据结构-哈希表(C语言)
哈希表的概念 哈希表就是: “将记录的存储位置与它的关键字之间建立一个对应关系,使每个关键字和一个唯一的存储位置对 应。” 哈希表又称:“散列法”、“杂凑法”、“关键字:地址法”。 哈希表思想 基本思想是在关键字和存…...

HCIA-综合实验(三)
综合实验(三) 1 实验拓扑2 IP 规划3 实验需求一、福州思博网络规划如下:二、上海思博网络规划如下:三、福州思博与上海思博网络互联四、网络优化 4 配置思路4.1 福州思博配置在 SW1、SW2、SW3 上配置交换网络SW1、SW2、SW3 运行 S…...

Java程序员的成长路径
熟悉JAVA语言基础语法。 学习JAVA基础知识,推荐阅读书单中的经典书籍。 理解并掌握面向对象的特性,比如继承,多态,覆盖,重载等含义,并正确运用。 熟悉SDK中常见类和API的使用,比如࿱…...

几种常用的排序
int[] arr new int[]{1, 2,8, 7, 5};这是提前准备好的数组 冒泡排序 public static void bubbleSort(int[] arr) {int len arr.length;for (int i 0; i < len - 1; i) {for (int j 0; j < len - i - 1; j) {if (arr[j] > arr[j1]) {int temp arr[j];arr[j] ar…...

性能测试【第三篇】Jmeter的使用
线程数:10 ,设置10个并发 Ramp-Up时间(秒):所有线程在多少时间内启动,如果设置5,那么每秒启动2个线程 循环次数:请求的重复次数,如果勾选"永远"将一直发送请求 持续时间时间:设置场景运行的时间 启动延迟:设置场景延迟启动时间 响应断言 响应断言模式匹配规则 包括…...

业务:业务系统检查项参考
名录明细云平台摸底1.原有云平台体系:VMware、openstack、ovirt、k8s、docker、混合云系列及版本 2.原有云平台规模,物理机数量、虚拟机数量、迁移业务系统所占配额 3.待补充系统摸底 (适用于物理主机)每一台虚拟机或物理机: 1.系统全局参数…...

解决公网下,k8s calico master节点无法访问node节点创建的pod
目的:解决pod部署成功后,只能在node节点访问,而master节点无法访问 原因:集群搭建时,没有配置公网进行kubectl操作,从而导致系统默认node节点,使用内网IP加入k8s集群!如下ÿ…...

六边形架构
Alistair Cockburn是于1953年出生在美国的一位软件开发方法学家。他毕业于康奈尔大学计算机科学专业,并获得了博士学位。 Cockburn在敏捷软件开发领域做出了许多重要的贡献,他被广泛认可为敏捷方法学的奠基人之一。他提出了许多关于敏捷开发的原则和实践…...

基于单片机的智能家居安保系统(论文+源码)
1.系统设计 本次基于单片机的智能家居安保系统设计,在功能上如下: 1)以51单片机为系统控制核心; 2)温度传感器、人体红外静释电、烟雾传感器来实现检测目的; 3)以GSM模块辅以按键来实现远/近程…...

盘点3种Python网络爬虫过程中的中文乱码的处理方法
网络爬虫过程中三种中文乱码的处理方案,希望对大家的学习有所帮助 一、思路 其实解决问题的关键点就是在于一点,就是将乱码的部分进行处理,而处理的方案主要可以从两个方面进行出发。其一是针对整体网页进行提前编码,其二是针对…...

小程序富文本图片大小问题
文章目录 概要uniapp小程序情况解决方法及完整示例 概要 在小程序使用富文本或者在nuiapp(小程序的)使用富文本都会转为 <rich-text nodes"<p class"p class">内容</p>”></rich-text>如果是这种情况的话在css…...