?? ?? ???? ???? ???? ?????? ?????, ??? ??? ?????? ???? ????? ?? ??? ????. ???? ??? ?????? ??? ????? ?? ????. ?? ????? ?? ????? ????? ??? ????? ????? ???? ???? ???? ?????? ?? ?????(?? ???, ?? ?)? ???? ???. ?? ?? ???? ???????!
java ????? ?? ??
1. URL
URL url = new URL(path); HttpURLConnection conn = (HttpURLConnection) url.openConnection();
2? ??? ???. ?? ?? ?? ??
conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
#?? ??#3. httpUrlConnection?? ???? ??? ????, httpUrlConnection?? ??? ??? ?????.
?? ??? ??? ?? ? ?? ????? ???? ? ? ?? HTTP ??? ???? ???. ?? get ? post ??? ??? ????. ?? ???? ?? ?? ?? URL ??? ?? ????? ???? ???? ??? ?? ????. post? get? ???? post? ????? ??? ??? ????. URL ???? ???? ?? http ?? ??? ?????.conn.setDoOutput(true); conn.setDoInput(true);
4. Disconnect
?? TCP ?? ??? ??? ?? ???? ?? ??? ????? ???? ?? ?? ????. ?? . ?? ????? ?? ?? ???? ??? ????. ?????? ??? ?? ??? ?? ??? ? ?? ??? ???? ?? ? ?? ??? ?? ?? ?????. ?? ??? ? ??? ??????.conn.disconnect();?? ?? ??:
package com.c; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.net.URL; public class ToInterface { /** * 調(diào)用對方接口方法 * @param path 對方或第三方提供的路徑 * @param data 向?qū)Ψ交虻谌桨l(fā)送的數(shù)據(jù),大多數(shù)情況下給對方發(fā)送JSON數(shù)據(jù)讓對方解析 */ public static void interfaceUtil(String path,String data) { try { URL url = new URL(path); //打開和url之間的連接 HttpURLConnection conn = (HttpURLConnection) url.openConnection(); PrintWriter out = null; //請求方式 // conn.setRequestMethod("POST"); // //設(shè)置通用的請求屬性 conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); //設(shè)置是否向httpUrlConnection輸出,設(shè)置是否從httpUrlConnection讀入,此外發(fā)送post請求必須設(shè)置這兩個 //最常用的Http請求無非是get和post,get請求可以獲取靜態(tài)頁面,也可以把參數(shù)放在URL字串后面,傳遞給servlet, //post與get的 不同之處在于post的參數(shù)不是放在URL字串里面,而是放在http請求的正文內(nèi)。 conn.setDoOutput(true); conn.setDoInput(true); //獲取URLConnection對象對應(yīng)的輸出流 out = new PrintWriter(conn.getOutputStream()); //發(fā)送請求參數(shù)即數(shù)據(jù) out.print(data); //緩沖數(shù)據(jù) out.flush(); //獲取URLConnection對象對應(yīng)的輸入流 InputStream is = conn.getInputStream(); //構(gòu)造一個字符流緩存 BufferedReader br = new BufferedReader(new InputStreamReader(is)); String str = ""; while ((str = br.readLine()) != null) { System.out.println(str); } //關(guān)閉流 is.close(); //斷開連接,最好寫上,disconnect是在底層tcp socket鏈接空閑時才切斷。如果正在被其他線程使用就不切斷。 //固定多線程的話,如果不disconnect,鏈接會增多,直到收發(fā)不出信息。寫上disconnect后正常一些。 conn.disconnect(); System.out.println("完整結(jié)束"); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { interfaceUtil("http://api.map.baidu.com/telematics/v3/weather?location=嘉興&output=json&ak=5slgyqGDENN7Sy7pw29IUvrZ", ""); // interfaceUtil("http://192.168.10.89:8080/eoffice-restful/resources/sys/oadata", "usercode=10012"); // interfaceUtil("http://192.168.10.89:8080/eoffice-restful/resources/sys/oaholiday", // "floor=first&year=2017&month=9&isLeader=N"); } }php ??? ????, ??? ??
Java ?? ???? , ??? ?????. ???!
? ??? Java?? ?????? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

Pre-FormancetArtUptimeMoryUsage, Quarkusandmicronautleadduetocompile-timeprocessingandgraalvsupport, withquarkusoftenperforminglightbetterine serverless sinarios.2.thyvelopecosyste,

NetworkPortSandfirewallsworkTogetToenableCommunication whileensuringsecurity.1.networkportSarevirtualendpointsnumbered0–65535, Withwell-nownports like80 (http), 443 (https), 22 (ssh) ? 25 (smtp) ?? (specservices

Java 's Garbage Collection (GC)? ???? ???? ???? ??????, ?? ? ??? ??? ? ??? ??? ??? ??? ????. 1.GC? ?? ?? (? : ?? ??, ?? ???, ?? ?? ?)?? ??? ???? ????, ?? ? ??? ??? ???? ?????. 2. ?? ???? ????? ????, ?? ?? ??? ??? ???? ?? ??? ??????. 3. ?? ?? ?? ?? : ??? ?? (Eden, S0, S1)? ?? ????? ?????. ??? ??? ?? ? MajorGC? ???? ? ??? ? ????. Metaspace? ??? ?? ???? ?????. 4. JVM? ??? GC ??? ?????. SerialGC? ??? ?? ????? ?????. ParallelGC? ???? ??????. CMS? ?? ???

GradleisBetTerChoiceFormostNewProjectSduetoitssuperiorflexible, Performance, and ModernToolingsupport.1.Gradle'Sgroovy/kotlindslismoreConcisENDEXPRESSIVETHANMAVEN'SVOSEXML.2.GradleOutsMaveninbuildweedweedweedweedweedweedweedweedweedweedweedweedweedweede

DEFER? ??? ???? ?? ??? ??? ???? ? ?????. ?? ??? ?? ? ? ?? ????, ??? ??? ? ?? ?? (LIFO)? ??? ?????. 1. ?? ??? ??? ? ??? ?????. 2. ?? ??? ?? ??? ??? ????? ?????. 3. ?? ? ?? ?? ??? ? ????. 4. ??? ?????? ??? ??? ???? ?????. 5. ?? ??? ???? ?? ??? ?? ??? ?????. ??? ??? ?? ?? ? ???? ???? ? ????.

??? htmlinput ??? ???? ??? ???? ????? ??? ??? ?? ??? ???? ???? ? ????. 1. ???, ???, ??, ?? ? ??? ?? ??? ??? ?? ?? ?? ??? ???? ???? ??? ? ???? ??? ? ????. 2. HTML5? ?????? ??? ? ?? ?? ??? ?? ? ??? URL, ??, ?? ? ??? ?? ??? ??? ??????. 3. ?? ?? ? ? ??? ??? ???? ?? ??? ???? ???? ?? ???? ?? ???? ???? ?? ? ? ??? ?? ???????.
