Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":1339,"date":"2014-08-21T17:44:55","date_gmt":"2014-08-21T20:44:55","guid":{"rendered":"http:\/\/www.feltex.com.br\/felix\/?p=1339"},"modified":"2015-02-20T02:35:36","modified_gmt":"2015-02-20T04:35:36","slug":"conexao-httpclient","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/conexao-httpclient\/","title":{"rendered":"Dica r\u00e1pida: como fazer conex\u00e3o HTTPClient"},"content":{"rendered":"

Dica r\u00e1pida: como fazer conex\u00e3o HTTPClient<\/H1><\/p>\n

Ol\u00e1 amigos. Hoje vamos conhecer o HTTpClient. Quando precisamos acessar dados pela via protocolo HTTP sem utilizar o browser precisamos implementar uma solu\u00e7\u00e3o din\u00e2mica e totalmente controlada por nossa aplica\u00e7\u00e3o.
\n M\u00e3os \u00e0 obra!<\/p>\n

\"HttpClient\"<\/p>\n

<\/p>\n

1. Acesso B\u00e1sico<\/H2><\/p>\n

O projeto de hoje consiste em acessar um site na internet e ler todo o conte\u00fado textual e exibir esses dados na console do nosso programa.<\/p>\n

\r\n\r\npackage br.com.feltex.http;\r\n\r\nimport java.io.BufferedReader;\r\nimport java.io.InputStreamReader;\r\nimport java.net.URL;\r\n\r\npublic class ConexaoHTTP {\t\r\n\tpublic static void main(String[] args) {\r\n\t\ttry {\t\r\n\t\t\tURL url = new URL(\"https:\/\/www.feltex.com.br\/felix\");\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\turl.openStream()));\r\n\t\t\tString str = \"\";\r\n\t\t\twhile ((str = in.readLine()) != null) {\r\n\t\t\t\tSystem.out.println(str);\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n

Voc\u00ea ter\u00e1 como resultado todo o c\u00f3digo HTML da p\u00e1gina buscada. O passo seguinte \u00e9 voc\u00ea fazer o tratamento que desejar.<\/p>\n

\r\na#nbar_downArr.bottom{border-bottom-color:#23ADCF;} \r\n#nbar_downArr{margin-top:4px;}\r\n#notificationbar .nbar_topwrap .nbar_msg{font-size:12px;color:#f3eeee; }\r\n#notificationbar .nbar_topwrap .nbar_button{font-size:12px;color:#fbf8e6;background:#57380b}\r\n#notificationbar .nbar_extendmsg .nbar_extendmsg_txt{font-size:12px;color:#ffffff; }\r\n#notificationbar .nbar_extendmsg .nbar_extendmsg_btn{font-size:12px;color:#fde8c0;background:#62562e}\r\n#notificationbar .nbar_extendmsg .nbar_extendmsg_img{width:150px;height:150px;border-width:2px;border-color:#fff;}\r\n<\/style>\r\n
\r\n\t
\r\n\t\t
\r\n\t\t\t
Get my Subscription<\/div>\t\t\t Click here<\/a>\t\t\t
\r\n\t\t\t\t<\/a>\t\t\t\t<\/a>\t\t\t\t<\/a>\t\t\t\t<\/a>\t\t\t\t\t\t\t\t