以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请问如何用foxtable代码实现  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=170699)

--  作者:xa139
--  发布时间:2021/8/4 11:07:00
--  请问如何用foxtable代码实现

需要通过接口来调用ocr识别功能,提供了一些接口,最通用的是不是 http方法,
请问下这个http接口的调用,foxtable里应如何实现
-------------------------------------------------------------------------------------------------------------------------
说明网站 https://devcenter.cloud.deepfinch.com/example.html#1
-------------------------------------------------------------------------------------------------------------------------

示例接口

以身份证识别接口为例(其他接口URL参考对应接口文档)

https://cloudapi.deepfinch.com/ocr/idcard

1.HTTP 样例

POST /ocr/idcard HTTP/1.1
Host: cloudapi.deepfinch.com
X-DF-API-SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-DF-API-ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="idcard3.jpg"
Content-Type: image/jpeg

...
------WebKitFormBoundary7MA4YWxkTrZu0gW--


--  作者:有点蓝
--  发布时间:2021/8/4 11:28:00
--  
类似:

Dim hc As New HttpClient("https://cloudapi.deepfinch.com/ocr/idcard")
hc.ContentType = "application/x-www-form-urlencoded"
hc
.Headers.Add("X-DF-API-ID","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
hc.Headers.Add("X-DF-API-SECRET","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
hc.Files.Add("file","c:\\data\\idcard3.jpg")
Dim ret as string = hc.GetData
Output
.Show(ret)