HarRequest.Postdata() returning NULL - JAVA + SELENIUM+BROWSER PROXY
<p>I'm currently working on Selenium to automate a web testing framework
For HTTP traffic , i am using browsermob proxy
I am getting the POST,GET commands correctly  through har classes</p>

<p>But on a post command with correct post data , i'm not able to track the post data, It returns NULL </p>

<p>I'm using getPostData() for this
Can you please help me on this
Will getPostData() returns the actual post data </p>

<p>Code Snippet :</p>

<pre><code>    System.out.println("getting the HAR data");
    har = server.getHar();
    if(har==null){
    System.out.println("Har is NULL");
    }
    HarLog harLog = har.getLog(); 
    List&lt;HarEntry&gt; logEntries = harLog.getEntries(); 
    System.out.println("getting the HAR data");
    String httpgetMethod =null;
    String posttext=null,postFileName=null,postContentType=null,postName=null,postValue=null;
    harRequest = new HarRequest();

    for (HarEntry harEntry : logEntries){ 
        //Retrieve the Request values
        org.browsermob.core.har.HarResponse response = harEntry.getResponse();   

        org.browsermob.core.har.HarRequest harRequest = harEntry.getRequest();
        if (response == null){ 
            System.out.println("Null response - "+harRequest.getUrl()); 
                continue; 
        } 


        int status = response.getStatus(); 
        httpgetMethod  = harRequest.getMethod();
        System.out.println(harRequest.getUrl()+" - "+status); 
        System.out.println("Method = "+httpgetMethod);

        if (httpgetMethod.equals("POST"))
            {
            postdata1 = harRequest.getPostData(); //HERE I AM GETTING NULL INSTEAD:-(
            if (postdata1!=null){
            System.out.println("Hurray!!!!!!!!!!!!!!!!postdata!=null");
            }
            else{
                System.out.println("postdata is null");
            }
        }

        if (httpgetMethod.equals(postcommand) &amp;&amp; (postdata1!=null)){

            try{
            posttext =postdata1.getText();
            }

            catch(Exception e){
            e.printStackTrace();
            }

            if (posttext == null){ 
                System.out.println("Post Data NULL"); 
                //continue; 
            } 
            else{
            System.out.println("postdata text = "+posttext);
            }


            if (((HarPostDataParam) postdata1.getParams()).getFileName() != null)
            System.out.println("postFileName = "+((HarPostDataParam) postdata1.getParams()).getFileName());
            if (((HarPostDataParam) postdata1.getParams()).getContentType() != null)
                System.out.println("getContentType = "+((HarPostDataParam) postdata1.getParams()).getContentType());
            if (((HarPostDataParam) postdata1.getParams()).getName() != null)
                System.out.println("getName = "+((HarPostDataParam) postdata1.getParams()).getName());
            if (((HarPostDataParam) postdata1.getParams()).getValue() != null)
            System.out.println("getValue = "+((HarPostDataParam) postdata1.getParams()).getValue());
             List&lt;HarPostDataParam&gt; postdataparams = postdata1.getParams();
            for(HarPostDataParam posdatap : postdataparams)
            {
                 postFileName=posdatap.getFileName();
                 postContentType = posdatap.getContentType();
                 postName = posdatap.getName();
                 postValue=posdatap.getValue();
                 if ((postFileName) != null){ 
                    System.out.println("postFileName = "+postFileName); 

                 } 
                 else{
                    System.out.println("postFileNameis NULL");
                    }
                 if ((postContentType) != null){ 
                    System.out.println("postContentType = "+postContentType); 
                 }
                 else{
                    System.out.println("postContentType  is NULL");
                    } 
                 if ((postName) != null){ 
                    System.out.println("postName = "+postName); 

                   } 
                 else{
                    System.out.println("postName  is NULL");
                    } 
                 if ((postValue) != null){ 
                        System.out.println("postValue = "+postValue); 

                    } 
                 else{
                        System.out.println("postValue  is NULL");
                     } 
            }


} }
</code></pre>

<p>Thanks</p>
