erlang http linux curl 返回空的问题
2015-06-15 15:33
288 查看
curl 返回结果为空,但是相同的url在浏览器上正常返回
可能原因是erlang 编写的http服务器返回结果没有添加http头。
将内容添加Http头代码如下
可能原因是erlang 编写的http服务器返回结果没有添加http头。
将内容添加Http头代码如下
encode_http_bin(List) -> Head = io_lib:format("HTTP/1.1 200 OK\r\n" "Content-Type: text/plain\r\n" "Content-Length: ~p\r\n\r\n, lenght(List)), <<(list_to_binary(Head))/binary, (list_to_binary(List))/binary>>.
相关文章推荐
- Linux网络编程——tcp并发服务器(多线程)
- Android进阶—GridView加载网络图片
- http://www.cnblogs.com/miyosan/archive/2012/07/18/2596654.html
- Servlet--HttpServletRequest接口,HttpServletResponse接口
- Servlet--HttpServletRequest接口,HttpServletResponse接口
- java web程序中项目名的更改(http://localhost:8080/)后面的名字
- 使用Embed标签在AS3项目中嵌入字体(转自http://zengrong.net/post/1438.htm)
- 用Dart搭建HTTP服务器(3)
- Linux网络编程——tcp并发服务器(多进程)
- C#模拟http 发送post或get请求
- 嵌入式操作系统VxWorks中网络协议存储池原理及实现
- 虚拟机下的ubuntu12.04设置桥接网络
- Servlet--HttpServlet类
- Servlet--HttpServlet类
- 5种服务器网络编程模型讲解
- HttpClient使用详解(转)
- TCP/IP四层模型和OSI七层模型的概念
- 黑马程序员-网络编程
- 对socket、tcp、udp、http 的认识
- 创建ASP.NET Web API项目 http://www.cnblogs.com/darrenji/p/4437680.html#3200330