Server returned HTTP response code: 400 for URL

代码如下
String s = HttpHelper.doGet(articleVO.getImg()+"?x-oss-process=image/info");
用阿里云的info获取图片的信息 路径没有问题 可以打开 但是却报错
java.io.IOException: Server returned HTTP response code: 400 for URL:
不知道是什么原因 进行去除空格之后还是出现这种一样报异常 请大佬帮忙看一下是什么原因

2个回答

HTTP响应400,找不到页面的意思,检查一下是否是路径错了;
图片说明

400是参数有误,检查你的传递参数

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Server returned HTTP response code: 403 for URL:
出现这种问题很头痛,不知道是不是访问不到对端服务,还是有其它问题 2017-3-21 9:05:03 com.sun.xml.ws.server.sei.TieHandler createResponse 严重: 无法访问位于以下位置的 WSDL: http://xxxxxxx?wsdl。该操作失败并显示: Server returned HTTP response code: 403 for URL: http://xxxxxx?wsdl。 javax.xml.ws.WebServiceException: 无法访问位于以下位置的 WSDL: http:xxxxxxxx?wsdl。该操作失败并显示: Server returned HTTP response code: 403 for URL: xxxx
Server returned HTTP response code: 403 for URL:
Java代码中访问链接提示java.io.IOException: Server returned HTTP response code: 403 for URL: 错误 ``` URL url = new URL(requestUrl); httpUrlConn = (HttpURLConnection) url.openConnection(); httpUrlConn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); ``` 已经设置了User-Agent还是不行 ``` java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.dianping.com/shop/93433662 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.Utils.MyFunction.httpRequest(MyFunction.java:37) at com.net.service.DianPing.getDianPing(DianPing.java:41) at com.net.service.TodayTemperatureService.getDianPing(TodayTemperatureService.java:164) at com.net.service.TodayTemperatureService.main(TodayTemperatureService.java:174) ```
请教Java 网络编程 Server returned HTTP response code: 400
下面是简单的代码: URL url = new URL(uri); URLConnection rulConnection = url.openConnection(); HttpURLConnection httpUrlConnection = (HttpURLConnection) rulConnection; httpUrlConnection.setDoInput(true); httpUrlConnection.setUseCaches(false); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection.connect(); InputStreamReader isr =new InputStreamReader(httpUrlConnection.getInputStream(),"GB2312"); 如果我的uri 是http://search.jd.com/Search?keyword=华为&enc=utf-8&area=2 没问题,能够读取网页内容 可是换成http://item.jd.com/827017.html 就会抛异常 java.io.IOException: Server returned HTTP response code: 400 for URL: http://item.jd.com/827017.html at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) at ReadURL.getBufferedFromURL(ReadURL.java:12) at ReadURL.getItemDetail(ReadURL.java:29) at ReadURL.main(ReadURL.java:83) java.lang.NullPointerException 请问这是为什么同一个网站的不同网址,为什么有的能访问,有的抛异常?
java.io.IOException: Server returned HTTP response code: 505 for URL
碰到个很奇怪的问题: 代码如下: URL url = new URL(urlStr); URLConnection hpCon = url.openConnection(); InputStream in = hpCon.getInputStream(); 然后我发送的一个URL是 : http://localhost:8000/account/accountTo.query?param=SR4A V12f 报错:java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8000/account/accountTo.query?param=SR4A V12f 这个URL在任何的浏览器都有数据显示,说明和服务器的通信正常。 这里的参数 param=SR4A V12f 中间有个空格 ,我尝试了如果没有空格,访问正常,能够得到数据。是不是因为多了个空格而出问题了?
java.io.IOException: Server returned HTTP response code: 502 for URL:XXXXXX
我在从系统数据库中拿到20W张图片的url,然后下载到本地的时候部分图片下载出现了这个错误: java.io.IOException: Server returned HTTP response code: 502 for URL:XXXXX 代码: ``` public static String downLoadFromUrl(String urlStr, String fileName, String savePath) { JSONObject response = new JSONObject(); JSONArray failds = new JSONArray(); try { URL url = new URL(urlStr); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); // 设置超时间为3秒 conn.setConnectTimeout(10 * 1000); // 防止屏蔽程序抓取而返回403错误 conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); // 得到输入流 InputStream inputStream = conn.getInputStream(); // 获取自己数组 byte[] getData = readInputStream(inputStream); // 文件保存位置 File saveDir = new File(savePath); if (!saveDir.exists()) { saveDir.mkdirs(); logger.info("创建文件夹:" + saveDir.exists()); } File file = new File(saveDir + File.separator + fileName); FileOutputStream fos = new FileOutputStream(file); fos.write(getData); if (fos != null) { fos.close(); } if (inputStream != null) { inputStream.close(); } return saveDir + File.separator + fileName; } catch (Exception e) { logger.error(">>>>>>image download faild,image url:" + urlStr + ",fileName:"+ fileName); failds.add(urlStr); e.printStackTrace(); } response.put("faild",failds); return response.toString(); } public InputStream getConnectionStream(String fullUrl) throws IOException { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(fullUrl); HttpResponse response = client.execute(request); InputStream is = response.getEntity().getContent(); return is; } public static byte[] readInputStream(InputStream inputStream) throws IOException { byte[] buffer = new byte[1024]; int len = 0; ByteArrayOutputStream bos = new ByteArrayOutputStream(); while ((len = inputStream.read(buffer)) != -1) { bos.write(buffer, 0, len); } bos.close(); return bos.toByteArray(); } ``` 下载图片就是循环调用这块代码,我应该如何优化才能避免这个错?
微博粉丝服务平台扩展开发过程中遇到请求微博接口的400和未知源问题!
基于微博粉丝服务平台扩展开发过程中遇到请求微博接口的400和未知源问题! 希望各路大侠前来搭救!多谢! java.io.IOException: Server returned HTTP response code: 400 for URL: https://m.api.weibo.com/2/messages/menu/show.json?access_token=(此处略去) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
上传文件到服务器返回文件地址报错
Server returned HTTP response code: 504 for URL: (这里是服务器链接地址,省略)
使用IDEA运行maven插件没问题,使用mvn命令运行插件报错?
使用swagger2markup插件,在IDEA里可以直接运行插件,生成asciidoc文件。 ![图片说明](https://img-ask.csdn.net/upload/201902/28/1551323694_720508.png) IDEA运行的默认执行的命令: *** mvn io.github.swagger2markup:swagger2markup-maven-plugin:1.2.0:convertSwagger2markup。 因为要编写技术文档,所以我需要mvn命令,但用PowerShell执行mvn的时候就报错了。* ``` java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:8032/v2/api-docs at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at io.swagger.parser.util.RemoteUrl.urlToString(RemoteUrl.java:130) at io.swagger.parser.Swagger20Parser.read(Swagger20Parser.java:81) 。。。。。。。 ``` 项目是运行启动了的,8032/v2/api/docs能得到json数据
使用HttpURLConnection 返回 HTTP response code: 500
try { // 创建SSLContext对象,并使用我们指定的信任管理器初始化 TrustManager[] tm = { new MyX509TrustManager() }; SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); sslContext.init(null, tm, new java.security.SecureRandom()); // 从上述SSLContext对象中得到SSLSocketFactory对象 SSLSocketFactory ssf = sslContext.getSocketFactory(); URL url = new URL(requestUrl); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setSSLSocketFactory(ssf); conn.setRequestMethod(requestMethod); conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); // 设置请求方式(GET/POST) // 当outputStr不为null时向输出流写数据 if (null != outputStr) { OutputStream outputStream = conn.getOutputStream(); // 注意编码格式 outputStream.write(outputStr.getBytes("UTF-8")); outputStream.close(); } // 从输入流读取返回内容 InputStream inputStream = conn.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8"); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String str = null; StringBuffer buffer = new StringBuffer(); while ((str = bufferedReader.readLine()) != null) { buffer.append(str); 程序执行到InputStream inputStream = conn.getInputStream();抛出异常 java.io.IOException: Server returned HTTP response code: 500 我发现conn对象的method属性是get,和这有关系吗
https的图片通过java的URL类下载不了,报451错误
图片地址如下:https://swmedia-4cd6.kxcdn.com/media/catalogue/Aruba/Postage-stamps/A-s.jpg 每当执行下面的语句,到InputStream is = conn.getInputStream();的时候就会报如下错误:java.io.IOException: Server returned HTTP response code: 451 for URL 代码如下: URL url = new URL(src); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setDoInput(true); conn.setRequestMethod("GET"); InputStream is = conn.getInputStream();
who can help me solve the http 401 error
when use drools guvnor tools by configuration,it auto generate a binary package link url, like "http://localhost:8080/guvnor/rest/packages/knowledgebaseSource/binary " then i use it as a source to call ResourceFactory.newUrlResource(Uri uri) result is http response 401 error Detail infomation is :Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/guvnor/rest/packages/knowledgebaseSource/binary that's say i have no auth.....
状态码503的页面怎么获取到他的内容
我在向google发送请求时,返回了一个503的页面,这个页面是一个验证码加一些其他的东西,我想获取到这个页面的内容。 使用httpurlconnection获取输入流时异常了: Server returned HTTP response code: 503 for URL: http://www.google.com.hk/sorry/?continue= 。。。。 之后就获取不到页面的内容,可是浏览器就可以获取503页面的内容啊,他们是怎么做的
关于抓取带有参数的url源码的问题
现在在用spring mvc做一个小项目,需要抓取url对应网址的源码,我用的是httpUrlConnection,在url不带参数的情况下抓取没有问题,但是在有参数的地址就会报错,错误如下: java.io.IOException: Server returned HTTP response code: 500 for URL 百度看到有人说是“因为服务器的安全设置不接受Java程序作为客户端访问,解决方案是设置客户端的User Agent”于是我就在代码中加了这么一句 connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); 但是仍然是同样的结果,有人遇到过类似的问题么,可否指点一下小弟,不胜感激
java抓取雪球数据时连接老是失败,不知道是否被屏蔽还是参数不对
尝试了好多参数,都是一样的 Server returned HTTP response code: 400 for URL,不知道是不是雪球有限制,但是对照浏览器的请求,一模一样的做了设置也不行,多谢! 也用jsoup做同样的事情,还是同样的错误。 Java代码 收藏代码 [code="java"]package com.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.nio.charset.Charset; import org.json.JSONException; import org.json.JSONObject; public class test { private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } public static JSONObject readJsonFromUrl(String url) throws IOException, JSONException { URL u = new URL(url); URLConnection uc = (HttpURLConnection)u.openConnection(); uc.setRequestProperty("X-Requested-With","XMLHttpRequest"); uc.setRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 LBBROWSER"); // give it 15 seconds to respond uc.setReadTimeout(15*1000); uc.connect(); InputStream is = uc.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { is.close(); } } public static void main(String[] args) throws IOException, JSONException { // 设置代理 System.getProperties().setProperty("proxySet", "true"); System.getProperties().setProperty("http.proxyHost", "cn-proxy.xxx.com"); System.getProperties().setProperty("http.proxyPort", "80"); JSONObject json = readJsonFromUrl("http://xueqiu.com/stock/cata/stocklist.json?page=1&size=90&order=desc&orderby=name&exchange=CN&industry=%E5%9B%9E%E8%B4%AD&flag=1&_=1417428721184"); System.out.println(json.toString()); } } [/code] 引用 [code="java"]Exception in thread "main" java.io.IOException: Server returned HTTP response code: 400 for URL: http://xueqiu.com/stock/cata/stocklist.json?page=1&size=90&order=desc&orderby=name&exchange=CN&industry=%E5%9B%9E%E8%B4%AD&flag=1&_=1417428721184 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1241) at com.test.test.readJsonFromUrl(test.java:37) at com.test.test.main(test.java:54) [/code] 这个url返回的是一个json文件,内容大概如下,具体可以点击链接查看: Json代码 收藏代码 [code="java"]{"count":{"count":19.0},"success":"true","stocks":[{"symbol":"SZ395032","code":"395032","name":"债券回购","pettm":"","volume":"395277740","hasexist":"false","marketcapital":"0.0","current":"0.0","percent":"0.0","change":"0.0","high":"0.0","low":"0.0","high52w":"0.0","low52w":"0.0","trading_date":"","trading_days":"","actual_date":"","actual_days":"","net_profit":"","net_profit_day":"","net_profit_yield":"","net_cost":"","net_cost_day":"","net_cost_yield":""},{"symbol":"SH204001","code":"204001","name":"GC001","pettm":"","volume":"370904900","hasexist":"false","marketcapital":"0.0","current":"5.025","percent":"139.29","change":"2.925","high":"7.0","low":"4.0","high52w":"50.5","low52w":"0.1","trading_date":"","trading_days":"","actual_date":"","actual_days":"","net_profit":"","net_profit_day":"","net_profit_yield":"","net_cost":"","net_cost_day":"","net_cost_yield":""}]}[/code] 浏览器的heads: [code="java"]Remote Address:146.56.234.217:80 Request URL:http://xueqiu.com/stock/cata/stocklist.json?page=1&size=90&order=desc&orderby=name&exchange=CN&industry=%E5%9B%9E%E8%B4%AD&flag=1&_=1417428721184 Request Method:GET Status Code:200 OK Request Headersview source Accept:application/json, text/javascript, */*; q=0.01 Accept-Encoding:gzip,deflate,sdch Accept-Language:zh-CN,zh;q=0.8 Cache-Control:max-age=0 Cookie:bid=2a0ffaa0c8c292e9752b4f52fa2e1a8e_i2zlirov; snbim_minify=true; last_account=35159618%40qq.com; xq_a_token=iXFl2kLorOVMsEDZ78hkeg; xq_r_token=Hs8CSFgNGhjhS6App0McWe; __utmt=1; Hm_lvt_1db88642e346389874251b5a1eded6e3=1417060711,1417146659,1417410467; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1417428721; __utma=1.1126280283.1417060711.1417420694.1417428549.11; __utmb=1.2.10.1417428549; __utmc=1; __utmz=1.1417410467.8.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided) Host:xueqiu.com Proxy-Connection:keep-alive Referer:http://xueqiu.com/hq User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 LBBROWSER X-Requested-With:XMLHttpRequest[/code]
get请求,参数拼接,时间字符串拼接报错,然后大佬们说的我好想不太清楚咋弄,就新添了请求方法,和调用
java.io.IOException: Server returned HTTP response code: 400 for URL: http://api.baidu.com/getsyncusers?code=02&date=2019-10-10 10:16:00.0 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at com.dunan.zzjg.util.ApiGateToken.getResponseContext(ApiGateToken.java:115) at com.dunan.zzjg.service.impl.SysUserServiceImpl.setSyncUsers(SysUserServiceImpl.java:82) at com.dunan.zzjg.controller.DAapiController.userDate(DAapiController.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) /** * 根据请求地址及请求参数,获取服务器的相应信息 * * @param requestURL 请求地址 * @param requestParam 请求参数 * @param requestMethod "POST" or "GET" * @return */ public static String getResponseContext(String requestURL, String requestParam, String requestMethod,String token) { StringBuffer responseContext = new StringBuffer(); try { URL url = new URL(requestURL); // 此处的urlConnection对象实际上是根据URL的 URLConnection urlConn = url.openConnection(); urlConn.setConnectTimeout(30000); urlConn.setReadTimeout(30000); // 请求协议(此处是http)生成的URLConnection类 的子类HttpURLConnection,故此处最好将其转化 // 为HttpURLConnection类型的对象,以便用到 HttpURLConnection更多的API.如下: HttpURLConnection httpUrlConnection = (HttpURLConnection) urlConn; // 设置是否向httpUrlConnection输出,因为这个是post请求,参数要放在 // http正文内,因此需要设为true, 默认情况下是false; httpUrlConnection.setDoOutput(true); // 设置是否从httpUrlConnection读入,默认情况下是true; httpUrlConnection.setDoInput(true); // Post 请求不能使用缓存 httpUrlConnection.setUseCaches(false); // 设定传送的内容类型是可序列化的java对象 // (如果不设此项,在传送序列化对象时,当WEB服务默认的不是这种类型时可能抛java.io.EOFException) httpUrlConnection.setRequestProperty("Content-type","application/json"); // 设置 HttpURLConnection的字符编码 httpUrlConnection.setRequestProperty("Accept-Charset", "UTF-8"); if(StringUtils.isNotBlank(token)){ httpUrlConnection.setRequestProperty("Access-Token", token); } // 设定请求的方法为"POST",默认是GET httpUrlConnection.setRequestMethod(requestMethod); // 连接,从上述第2条中url.openConnection()至此的配置必须要在connect之前完成, // // 此处getOutputStream会隐含的进行connect(即:如同调用上面的connect()方法, // // 所以在开发中不调用上述的connect()也可以)。 if("POST".equals(requestMethod)){ OutputStream outStrm = httpUrlConnection.getOutputStream(); outStrm.write(requestParam.getBytes("UTF-8")); // // 刷新对象输出流,将任何字节都写入潜在的流中(些处为ObjectOutputStream) outStrm.flush(); // 关闭流对象。此时,不能再向对象输出流写入任何数据,先前写入的数据存在于内存缓冲区中, // 在调用下边的getInputStream()函数时才把准备好的http请求正式发送到服务器 outStrm.close(); } // 调用HttpURLConnection连接对象的getInputStream()函数, // 将内存缓冲区中封装好的完整的HTTP请求电文发送到服务端。 InputStream inStrm = httpUrlConnection.getInputStream(); // 读取文件流程 BufferedReader rd = new BufferedReader( new InputStreamReader(inStrm,"UTF-8")); // 采取行的方式进行读取 String tempLine = rd.readLine(); // 循环获取每一行数据 while (tempLine != null) { responseContext.append(tempLine); tempLine = rd.readLine(); } rd.close(); inStrm.close(); httpUrlConnection.disconnect(); httpUrlConnection = null; urlConn = null; url = null; } catch (Exception e) { e.printStackTrace(); } return responseContext.toString(); } /*获取上次更新的时间*/ TurnoverTime lastTime = timeMapper.selectTime(); String lastUpdateTime = lastTime.getLastUpdateTime(); System.out.println(lastUpdateTime); String url = "http://api.baidu.com/getsyncusers"; String param = "?code="+"02"+"&date="+lastUpdateTime; String requestMethod = "GET"; String token = ApiGateToken.getToken(); String responseContext = ApiGateToken.getResponseContext(url+param, param, requestMethod, token);
java http地址,发送post请求,eclipse运行没问题,打包成jar运行报错
java.io.IOException: Server returned HTTP response code: 400 for URL: http://113.204.53.18:8091/innosill/esb/schedule/receivingcarrierplan at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.hezhi.kylwsp.ui.stationCoordination.LinePlanManageUi.doPost(LinePlanManageUi.java:615) at com.hezhi.kylwsp.ui.stationCoordination.LinePlanManageUi.commitBtnMedth(LinePlanManageUi.java:566) at com.hezhi.kylwsp.ui.stationCoordination.LinePlanManageUi.BtnComMit(LinePlanManageUi.java:475) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.hezhi.ui.composite.button.HZbutton$1.widgetSelected(HZbutton.java:68) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at com.hezhi.kylwsp.ui.main.Main.open(Main.java:136) at com.hezhi.kylwsp.ui.main.LoginDialog$4.keyPressed(LoginDialog.java:326) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:161) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774) at org.eclipse.swt.custom.CCombo.textEvent(CCombo.java:1693) at org.eclipse.swt.custom.CCombo$1.handleEvent(CCombo.java:111) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103) at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1427) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268) at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2175) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160) at org.eclipse.swt.widgets.Text.windowProc(Text.java:2170) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655) at com.hezhi.kylwsp.ui.main.LoginDialog.open(LoginDialog.java:83) at com.hezhi.kylwsp.ui.main.Login.main(Login.java:308) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.exe4j.runtime.LauncherEngine.launch(Unknown Source) at com.exe4j.runtime.WinLauncher.main(Unknown Source) 封装的方法: public static String doPost(String parm,String url) { String result = ""; PrintWriter out = null; BufferedReader in = null; try { URL realUrl = new URL(url); // 打开和URL之间的连接 URLConnection conn = realUrl.openConnection(); // 设置通用的请求属性 //conn.setRequestMethod("POST"); conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); // 发送POST请求必须设置如下两行 conn.setDoOutput(true); conn.setDoInput(true); // 获取URLConnection对象对应的输出流 out = new PrintWriter(conn.getOutputStream()); // 发送请求参数 out.print(parm); // flush输出流的缓冲 out.flush(); // 定义BufferedReader输入流来读取URL的响应 in = new BufferedReader(new InputStreamReader(conn.getInputStream(),"utf-8")); // in = new OutputStreamWriter(con.getOutputStream()); String line; while ((line = in.readLine()) != null) { result += line; } } catch (Exception e) { System.out.println("发送 POST 请求出现异常!"+e); e.printStackTrace(); } //使用finally块来关闭输出流、输入流 finally{ try{ if(out!=null){ out.close(); } if(in!=null){ in.close(); } } catch(IOException ex){ ex.printStackTrace(); } } System.out.println(result); return result; }
NC启动客户端时候报的错误,急急急急
run in local application. 错误: Exception caught while download server code version, try again... 错误: Exception caught while download server code version, try again... 错误: Exception caught while download server code version, try again... 错误: Exception caught while download server code version, try again... URL:http://127.0.0.1:80 java.lang.RuntimeException: Exception caught while download server code version: at nc.bs.framework.codesync.client.DownloadService.downloadServerVID(DownloadService.java:96) at nc.bs.framework.codesync.client.DownloadService.initVID(DownloadService.java:29) at nc.bs.framework.codesync.client.LocalPackageVIDCache.initPackageVIDCache(LocalPackageVIDCache.java:10) at nc.ui.sm.login.AppletContainer.initCodeCacheParams(AppletContainer.java:552) at nc.ui.sm.login.AppletContainer.init(AppletContainer.java:395) at nc.starter.test.JStarter.StartNC(JStarter.java:128) at nc.starter.test.JStarter.main(JStarter.java:389) Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://127.0.0.1:80/CodeSynServlet at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1152) at nc.bs.framework.codesync.client.DownloadService.post(DownloadService.java:279) at nc.bs.framework.codesync.client.DownloadService.downloadServerVID(DownloadService.java:69) ... 6 more 这是错误代码!
关于cas使用saml协议验证问题
错误代码如下: HTTP Status 500 – Internal Server Error Type Exception Report Message IO error sending HTTP request to /samlValidate Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception java.lang.RuntimeException: IO error sending HTTP request to /samlValidate org.jasig.cas.client.validation.Saml11TicketValidator.retrieveResponseFromServer(Saml11TicketValidator.java:212) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:193) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:204) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:97) Root Cause java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9000/samlValidate?TARGET=http%3A%2F%2Flocalhost%3A8080%2F sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) org.jasig.cas.client.validation.Saml11TicketValidator.retrieveResponseFromServer(Saml11TicketValidator.java:210) org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:193) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:204) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:97) Note The full stack trace of the root cause is available in the server logs. cas server版本为4.0.7,关于saml协议的配置按照其官网的配置,不明白错误发生在哪里,求解答
URLConnection想实现不用登陆去访问URL
我访问的这个URL、只能用管理员的权限登陆才能访问,如果用cookie或者session能实现吗?该怎么实现? public BufferedReader send(String content) { try { URLConnection conn = new URL(url).openConnection(); conn.setRequestProperty("Content-Type", contentType); BASE64Encoder enc = new sun.misc.BASE64Encoder(); String userpassword = "admin" + ":" + "admin"; String encodedAuthorization = enc.encode( userpassword.getBytes() ); conn.setRequestProperty("Authorization", "Basic "+ encodedAuthorization); if (content != null) { conn.setRequestProperty("Content-Length", String.valueOf(content.getBytes(charset).length)); } conn.setDoInput(true); conn.setDoOutput(true); if (conn instanceof HttpURLConnection) { ((HttpURLConnection) conn).setRequestMethod(requestMethod_POST); } BufferedWriter w = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), Charset.forName(charset))); try { w.write(content); } finally { w.flush(); w.close(); } return new BufferedReader(new InputStreamReader(conn.getInputStream(), Charset.forName(charset))); } catch (IOException e) { throw new RuntimeException(e); } } 这种方法会报Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 422 for URL: http://192.168.0.18/redmine/time_entries.xml 这个错误,我这是哪里写错了呢 422 - Unprocessable Entity 请求格式正确,但是由于含有语义错误,无法响应.这个错误怎么解决呢 ?请大神们指点!
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
剑指Offer对答如流系列 - 重建二叉树
面试题6:重建二叉树 题目:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建出图2.6所示的二叉树并输出它的头结点。二叉树结点的定义如下: class TreeNode{ int val; TreeNode l...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
一份王者荣耀的英雄数据报告
咪哥杂谈本篇阅读时间约为 6 分钟。1前言前一阵写了关于王者的一些系列文章,从数据的获取到数据清洗,数据落地,都是为了本篇的铺垫。今天来实现一下,看看不同维度得到的结论。2环境准备本次实...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
【蘑菇街技术部年会】程序员与女神共舞,鼻血再次没止住。(文末内推)
蘑菇街技术部的年会,别开生面,一样全是美女。
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
立即提问