How to call the API of BTC browser
Publish: 2021-05-04 22:38:34
1. No, these three are not compatible with each other and each has its own purpose
choose your own direction
the cost of developing an interface is not so high. Except for EOS, there is not much data to be chained, which is basically completed locally. As a top blockchain technology developer in China, weisanyun is still a good technology developer.
choose your own direction
the cost of developing an interface is not so high. Except for EOS, there is not much data to be chained, which is basically completed locally. As a top blockchain technology developer in China, weisanyun is still a good technology developer.
2. View plainprint?
<? php
* DATE:2014-07-29
>
& #39 39; < br/> #api No
$apicode=& #39; caipiao ' < br/> $ rettype=& #39; xml ' # Providing json and xml in two forms, select I
$ url = & #39 in use; http://192.168.1.15/data/getData.htm' ;# The requested data interface URL
$ c=& #39; dlt ' < br/> $ params =& #39;& apikey='$ apikey.'& apicode='$ apicode.'& rettype='$ rettype.'& c='$ c; < br/ >
$ content = getData($url.'?' 39. $ Parms); < / br/ > } else {
< echo & #39; #39; < br/ / /br/ / / / /br/ / / /br/ / / / / / / /br// / / / / / /br/ / / / / / / / / / / / / / / /
/curl_setopt($ch, CURLOPT_URL, $url); < br/ > / /curl_setopt($ch, CURLOPT_HEADER, 0); < br/ / / / /curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) / / retrieve data
/ / / / / / capture URLs and transmit it to the browser
/ $ response = curl_exec($ch); < br />
/ /curl_close($ch); < br />
/ < return $response; <
> <
br > <
*@author datatang
@version 1.0
@create date 2014/08
*/
import java.io.BufferedReader; < br/>Import java.io.IOException; < br/>Import java.io.InputStream; < br/>Import java.io.InputStreamReader; < br/>Import java.net.HttpURLConnection; < br/>Import java.net.URL; < br/>
import org.apache.log4j.Logger; < / br/ / / / / / / / / / / / / /public static void main(String[]args) {
< String strUrl = " http://api.datatang.com/data/getData.htm"; < br/ / / / / /dtkey / / API KEY applied for via page. (must be projected)
= String strKey = " XXXXXXXXXXXXXXXXXXXX " < br/ / / / / / / /apicode/ Encoding API (required projects)
/String strApicode = " < br/ / / / //rettype / Form of return required (support XML and JSON) (need projects)
/String strRettype = " < br/ > / / / / / / / /API needs parameters (detailed reference to painting-various API parameters)
/String strparam = " ) < br/ / / / / / / /e.g.
/ /strparam = " datatype=ore&startDate=2014-06-30&endDate=2014-06-30" < br/ / / / / / / /
/ / /String url = strUrl + "? apikey=" + strKey + "" apicode=" + strApicode + "" rettype=" + strRettype
& > quot;+ strparam; < br/ > /try
< String res = readByGet(url); < br/ > > System.out.println(res); < br/ > } catch (IOException e) {
< e.printStackTrace(); < br br/ / / /br/ / / /
* br/ / / / / / /
* * param inUrl in Url request url
* @param inUrl in Url request url
/private static String readByGet(String inUrl) throws IOException {
/StringBuffer sbf = new StringBuffer();
> String strRead = zero; < br/ >
/ / / / / / / / / / / / / /String userAgent = " Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 " < br /> & + "( KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36 " < br/ / /
/ /URL = new URL (inUrl); < br/ / / / / / / / / / / / / / / / / / / / /fort 20945; / fort 20945; / / / / / / / / / / / / / / forts 20945; ; / openConnConnConnConnection communications will be opened on a connection, in accordance with URLs types of,
> connection.setReadTimeout(30000); < br/ > > connection.setConnectTimeout(30000); < RequestProperty(" User-agent ", userAgent); < br/ / / / / / / / / / / / / / / /connection.connect(); < br/ / / / / / / / / / / / / / / / / /InputStream is = connection.getInputStream(); < br/ > / / / / / / / / / / / / /BufferedReader = new BufferedReader UTF-8 ") ";< br/ > = while ((strRead = reader.readLine())= zero) {
> sbf.append(strRead); < br/ > /sbf.append(" 92; r\ n") < br/ > }
< reader.close(); < br/ / / / / / discontinue contact
/ / connection.disconnect(); < br/ > / /return sbf.toString(); < br/ >
<? php
* DATE:2014-07-29
>
& #39 39; < br/> #api No
$apicode=& #39; caipiao ' < br/> $ rettype=& #39; xml ' # Providing json and xml in two forms, select I
$ url = & #39 in use; http://192.168.1.15/data/getData.htm' ;# The requested data interface URL
$ c=& #39; dlt ' < br/> $ params =& #39;& apikey='$ apikey.'& apicode='$ apicode.'& rettype='$ rettype.'& c='$ c; < br/ >
$ content = getData($url.'?' 39. $ Parms); < / br/ > } else {
< echo & #39; #39; < br/ / /br/ / / / /br/ / / /br/ / / / / / / /br// / / / / / /br/ / / / / / / / / / / / / / / /
/curl_setopt($ch, CURLOPT_URL, $url); < br/ > / /curl_setopt($ch, CURLOPT_HEADER, 0); < br/ / / / /curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) / / retrieve data
/ / / / / / capture URLs and transmit it to the browser
/ $ response = curl_exec($ch); < br />
/ /curl_close($ch); < br />
/ < return $response; <
> <
br > <
*@author datatang
@version 1.0
@create date 2014/08
*/
import java.io.BufferedReader; < br/>Import java.io.IOException; < br/>Import java.io.InputStream; < br/>Import java.io.InputStreamReader; < br/>Import java.net.HttpURLConnection; < br/>Import java.net.URL; < br/>
import org.apache.log4j.Logger; < / br/ / / / / / / / / / / / / /public static void main(String[]args) {
< String strUrl = " http://api.datatang.com/data/getData.htm"; < br/ / / / / /dtkey / / API KEY applied for via page. (must be projected)
= String strKey = " XXXXXXXXXXXXXXXXXXXX " < br/ / / / / / / /apicode/ Encoding API (required projects)
/String strApicode = " < br/ / / / //rettype / Form of return required (support XML and JSON) (need projects)
/String strRettype = " < br/ > / / / / / / / /API needs parameters (detailed reference to painting-various API parameters)
/String strparam = " ) < br/ / / / / / / /e.g.
/ /strparam = " datatype=ore&startDate=2014-06-30&endDate=2014-06-30" < br/ / / / / / / /
/ / /String url = strUrl + "? apikey=" + strKey + "" apicode=" + strApicode + "" rettype=" + strRettype
& > quot;+ strparam; < br/ > /try
< String res = readByGet(url); < br/ > > System.out.println(res); < br/ > } catch (IOException e) {
< e.printStackTrace(); < br br/ / / /br/ / / /
* br/ / / / / / /
* * param inUrl in Url request url
* @param inUrl in Url request url
/private static String readByGet(String inUrl) throws IOException {
/StringBuffer sbf = new StringBuffer();
> String strRead = zero; < br/ >
/ / / / / / / / / / / / / /String userAgent = " Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 " < br /> & + "( KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36 " < br/ / /
/ /URL = new URL (inUrl); < br/ / / / / / / / / / / / / / / / / / / / /fort 20945; / fort 20945; / / / / / / / / / / / / / / forts 20945; ; / openConnConnConnConnection communications will be opened on a connection, in accordance with URLs types of,
> connection.setReadTimeout(30000); < br/ > > connection.setConnectTimeout(30000); < RequestProperty(" User-agent ", userAgent); < br/ / / / / / / / / / / / / / / /connection.connect(); < br/ / / / / / / / / / / / / / / / / /InputStream is = connection.getInputStream(); < br/ > / / / / / / / / / / / / /BufferedReader = new BufferedReader UTF-8 ") ";< br/ > = while ((strRead = reader.readLine())= zero) {
> sbf.append(strRead); < br/ > /sbf.append(" 92; r\ n") < br/ > }
< reader.close(); < br/ / / / / / discontinue contact
/ / connection.disconnect(); < br/ > / /return sbf.toString(); < br/ >
3. This return is in JSON format, which should be translated in JS and then transferred into excel
4. Application of API based on standard interface
5. It is not possible to call API function directly in the web page.
Web page is
browser + HTML code
if you want to use JavaScript to determine whether an application is running, it is not practical to use plug-ins and clients to install plug-ins.
Web page is
browser + HTML code
if you want to use JavaScript to determine whether an application is running, it is not practical to use plug-ins and clients to install plug-ins.
6.
java发一个http请求过去,带上参数就可以了啊,跟我们在浏览器上访问资源是一样的只是它返回的是json格式的数据而已
给你两个方法吧:
publicstaticStringdo_post(Stringurl,List<NameValuePair>name_value_pair)throwsIOException{
Stringbody="{}";
DefaultHttpClienthttpclient=newDefaultHttpClient();
try{
HttpPosthttpost=newHttpPost(url);
httpost.setEntity(newUrlEncodedFormEntity(name_value_pair,StandardCharsets.UTF_8));
HttpResponseresponse=httpclient.execute(httpost);
HttpEntityentity=response.getEntity();
body=EntityUtils.toString(entity);
}finally{
httpclient.getConnectionManager().shutdown();
}
returnbody;
}
publicstaticStringdo_get(Stringurl)throwsClientProtocolException,IOException{
Stringbody="{}";
DefaultHttpClienthttpclient=newDefaultHttpClient();
try{
HttpGethttpget=newHttpGet(url);
HttpResponseresponse=httpclient.execute(httpget);
HttpEntityentity=response.getEntity();
body=EntityUtils.toString(entity);
}finally{
httpclient.getConnectionManager().shutdown();
}
returnbody;
}
7. VB API browser
first of all, you need to load the API text
which is the win32api.txt in the browser directory
after loading, you can query the API and constants normally
first of all, you need to load the API text
which is the win32api.txt in the browser directory
after loading, you can query the API and constants normally
8.
packagecom.demo;
importjava.io.BufferedReader;
importjava.io.IOException;
importjava.io.InputStreamReader;
importjavax.xml.bind.DatatypeConverter;
importorg.apache.http.HttpResponse;
importorg.apache.http.client.methods.HttpGet;
importorg.apache.http.impl.client.DefaultHttpClient;
publicclassrestTest{
publicstaticvoidmain(String[]args){
try{
DefaultHttpClientClient=newDefaultHttpClient();
HttpGethttpGet=newHttpGet("你的地址");
Stringencoding=DatatypeConverter.printBase64Binary("admin:admin".getBytes("UTF-8"));
httpGet.setHeader("Authorization","Basic"+encoding);
HttpResponseresponse=Client.execute(httpGet);
System.out.println("response="+response);
BufferedReaderbreader=newBufferedReader(newInputStreamReader(response.getEntity().getContent()));
StringBuilderresponseString=newStringBuilder();
Stringline="";
while((line=breader.readLine())!=null){
responseString.append(line);
}
breader.close();
StringrepsonseStr=responseString.toString();
System.out.println("repsonseStr="+repsonseStr);
}catch(IOExceptione){
e.printStackTrace();
}
}
}
9. It's difficult for the native API and the API leaked by the browser to reach tens of thousands, let alone hundreds of thousands. If you're talking about calling the API of the desktop operating system, you can use nodejs. If you're talking about calling the API of the smartphone operating system, you can let the object leaked by the WebView control encapsulate the system API, Or if you package your app with phonegap or something like that, you can call the API provided by it and check the corresponding documents for specific usage
10. Shell to buy a house, shell cash withdrawal estimate is unlikely, this can see your platform.
Hot content
