How can I make a JSON POST request with LWP?

后端 未结 4 1790
说谎
说谎 2020-12-12 21:03

If you try to login at https://orbit.theplanet.com/Login.aspx?url=/Default.aspx (use any username/password combination), you can see that the login credentials are sent as a

4条回答
  •  悲哀的现实
    2020-12-12 21:49

    If you really want to use WWW::Mechanize you can set the header 'content-type' before post

    $mech->add_header( 
    'content-type' => 'application/json'
    );
    
    $mech->post($uri, Content => $json);
    

提交回复
热议问题