1,set proxy 10.100.1.76 :8888

httpc:set_options([{proxy,{{"10.100.1.76",8888},[]}}]).

2,set cookie enabled

> httpc:set_options([{cookies,enabled}]).
ok

3,login and create team

 application:start(inets).
httpc:set_options([{cookies,enabled}]).
httpc:request("http://1.1.13.4/user/login").
httpc:request(post,{"post url --remember add v2",[],"application/x-www-form-urlencoded", lists:concat(["post string curl use -d"])},[],[]).
httpc:request(post,{"post url",[],"application/x-www-form-urlencoded", lists:concat(["post string curl use -d "])},[],[]). httpc:which_cookies().
[{session_cookies,[{http_cookie,"1.1.13.4",true,
"JSESSIONID","aaa6JQwGALt04aTzzID1u",undefined,session,"/",
false,false,"0"},
{http_cookie,"1.1.13.4",true,"X-XX-SESS-ID", %% u know what XX is
"f9vl028l6seblbh7v9i03ico02",undefined,session,"/",false,
false,"0"},
{http_cookie,"1.1.13.4",true,"language","zh",undefined,
session,"/",false,false,"0"}]}]

4,e.z test case

 File Edit Options Buffers Tools Help
-module(tt).
-export([max/1]). max(N)->
Max=erlang:system_info(process_limit),
io:format("Maximum allowd processes:~p~n",[Max]),
statistics(runtime),
statistics(wall_clock),
L=for(1,N,fun()-> spawn(fun()->wait() end) end),
{_,Time1}=statistics(runtime),
{_,Time2}=statistics(wall_clock),
lists:foreach(fun(Pid)->Pid ! die end, L),
U1=Time1 * 1000 / N ,
U2=Time2 * 1000 / N ,
io:format("Process spawn time=~p(~p) microseconds~n",
[U1,U2]). wait()->
receive
die -> httpc:request("http://192.168.1.51")
end.
for(N,N,F)->[F()];
for(I,N,F)->[F()|for(I+1,N,F)].

erlang httpc的更多相关文章

  1. [Erlang 0104] 当Erlang遇到Solr

        Joe Armstrong的访谈中有一段关于"打开黑盒子"的阐述,给我留下很深的印象:Joe Armstrong在做XWindows开发时没有使用对应的类库,而是在了解XW ...

  2. 当Erlang遇到Solr

    当Erlang遇到Solr   Joe Armstrong的访谈中有一段关于"打开黑盒子"的阐述,给我留下很深的印象:Joe Armstrong在做XWindows开发时没有使用对 ...

  3. erlang-百度云推送Android服务端功能实现-erlang

    百度云推送官方地址http://developer.baidu.com/wiki/index.php?title=docs/cplat/push 简单的介绍下原理: 百度云推送支持IOS和Androi ...

  4. erlang 爬虫——爬取网页图片

    说起爬虫,大家第一印象就是想到了python来做爬虫.其实,服务端语言好些都可以来实现这个东东. 在我们日常上网浏览网页的时候,经常会看到一些好看的图片,我们就希望把这些图片保存下载,或者用户用来做桌 ...

  5. erlang的undefined macro 'MODULE',头一行编译通不过的问题

    前言:对于erlang的编译有很多方式,rebar,makefile文件 还是对于单个文件的erlc编译等,但不管何种方式,一个模块的第一行就编译不过去,实在让人纠结... 1)问题上述: 在技术交流 ...

  6. erlang实现DNS解析域名

    erlang的DNS解析,有个inet模块,可以做这个事情,对应的api如下:(这里用的R16B的版本) inet:getaddr/2解析对应一个ip,而inet:getaddr/2解析有可能对应1个 ...

  7. erlang应用发布

    http://blog.csdn.net/zhangxinrun/article/details/6993892 参考“转载1”和“转载2”就可以了,但需要注意以下两点: 1.如果用rebar - c ...

  8. [Erlang 0129] Erlang 杂记 VI

    把之前阅读资料的时候记下的东西,整理了一下. Adding special-purpose processor support to the Erlang VM   P23 简单介绍了Erlang C ...

  9. [Erlang 0128] Term sharing in Erlang/OTP 下篇

    继续昨天的话题,昨天提到io:format对数据共享的间接影响,如果是下面两种情况恐怕更容易成为"坑", 呃,恰好我都遇到过; 如果是测试代码是下面这样,得到的结果会是怎样?猜! ...

随机推荐

  1. Node.js 手册查询-4-Express 方法

    express 标签(空格分隔): node.js express [TOC] 安装: 新版本中命令行工具分家了 npm install -g express //安装 express 然后 npm ...

  2. (转)如何将数据库从SQL Server迁移到MySQL

    一.迁移Database Schema. 首 先使用Sybase Powerdesigner的逆向工程功能,逆向出SQL Server数据库的物理模型.具体操作是在Powerdesigner中选择“F ...

  3. Update UI from an asynchronous thread

    One of the most common tasks you need to perform in a Windows Phone application is updating the UI f ...

  4. nginx“虚拟目录”不支持php的解决办法

    这几天在配置Nginx,PHP用FastCGI,想装一个phpMyAdmin管理数据库,phpMyAdmin不想放在网站根目录 下,这样不容易和网站应用混在一起,这样phpMyAdmin的目录就放在别 ...

  5. LaTex Remove Left Margin 去除左边空间

    LaTex中使用itemize的时候,默认的每一项左边都有一小段距离,并不是紧贴着边缘的,那么如果我们想去掉这段距离,我们可以使用下面的命令: \usepackage{enumitem} \setli ...

  6. [LintCode] Number of Islands 岛屿的数量

    Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is repr ...

  7. 建立和断开与MySQL服务器的连接

    MySQL 与 mysql 之间的区别: MySQL指完整的MySQL DBMS系统,mysql仅代表一个特定的客户程序. 连接服务器: >mysql -h host_name -p -u us ...

  8. lightetreeview

    http://www.16css.com/menu/905.html 其他树形菜单:很好--1.http://www.cnblogs.com/zhhh/archive/2011/11/25/22637 ...

  9. 三层架构dal 层基本代码 非查询/查询

    DAL 数据链路层 非查询/查询 using System;using System.Collections.Generic;using System.Linq;using System.Text;u ...

  10. IOS第11天(3:UIPickerView省市联动)

    ********* #import "ViewController.h" #import "Province.h" @interface ViewControl ...