login about faq

When i tried post URL web with content-type : application/x-www-form-urlencoded. but it not working. i using request.ContentType = "application/x-www-form-urlencoded"; and set header, but both is not working, i am receving header with contentType:text/html. How to fix it ?

Http http = new Http();

        bool success;
        http.SocksHostname = "127.0.0.1";
        http.SocksPort = 50000;
        http.SocksVersion = 5;
        http.CookieDir = "memory";
        http.SaveCookies = true;
        http.SendCookies = true;
        //  Any string unlocks the component for the 1st 30-days.
        success = http.UnlockComponent("Anything for 30-day trial");
        if (success != true)
        {
            Console.WriteLine(http.LastErrorText);
            return;
        }

        HttpRequest request = new HttpRequest();
        request.ContentType = "application/x-www-form-urlencoded";
        //Content-Type: application/x-www-form-urlencoded
        //  Add the form parameters to the HTTP request:
        request.AddParam("_dyncharset", "ISO-8859-1");
        request.AddParam("_dynSessConf", "6268568803919292891");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.login", "tester@gmail.com");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.login", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.password", "123456");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.value.password", "+");
        request.AddParam("newStrongPassword", "");
        request.AddParam("_D%3AnewStrongPassword", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.login", "Submit");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.login", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.employeeProfile", "");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.employeeProfile", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "http%3A%2F%2Fwww.neimanmarcus.com%2Findex.jsp%3Fnavid%3DaccountLogout%26_requestid%3D385928");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "+");
        request.AddParam("%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "http%3A%2F%2Fwww.neimanmarcus.com%2Findex.jsp%3Fnavid%3DaccountLogout%26_requestid%3D385928");
        request.AddParam("_D%3A%2Fatg%2Fuserprofiling%2FProfileFormHandler.refererURL", "+");
        request.AddParam("_DARGS", "%2Fpage_rwd%2Faccount%2Flogin.jsp");

        //  Send the HTTP POST by calling PostUrlEncoded.
        //  The Content-Type used w/ the request will be application/x-www-form-urlencoded
        HttpResponse response = null;
        response = http.PostUrlEncoded("https://www.neimanmarcus.com/min.jsp?_DARGS=/page_rwd/account/login.jsp", request);
        if (response == null)
        {
            Console.WriteLine(http.LastErrorText);
            return;
        }
        string[] str;

        Console.WriteLine(response.Header + response.BodyStr);

asked Jul 20 at 17:34

nh0kbstupid's gravatar image

nh0kbstupid
11


Can you explain how it's not working? In particular, can you post the contents of the LastErrorText property as defined immediately after the first failing call?

link

answered Jul 20 at 21:18

jpbro's gravatar image

jpbro ♦
1.1k2618

If there's no failing call, and you are indeed just received a "text/html" content type on the server side, can you confirm you are using the latest version of the Chilkat library?

(Jul 20 at 21:19) jpbro ♦

Yes i using last version Chilkat Lib. And how it's not working because website detected content type post is = "application/x-www-form-urlencoded" , but if u post with another content type website show nothing. If you use HTTP POST addon of firefox u can see that. U post with another content type it's never show anything, but if u post with content type "application/x-www-form-urlencoded" it's working

(Jul 21 at 17:04) nh0kbstupid

Yes i using last version Chilkat Lib. And how it's not working because website detected content type post is = "application/x-www-form-urlencoded" , but if u post with another content type website show nothing. If you use HTTP POST addon of firefox u can see that. U post with another content type it's never show anything, but if u post with content type "application/x-www-form-urlencoded" it's working

link

answered Jul 21 at 02:44

nh0kbstupid's gravatar image

nh0kbstupid
11

edited Jul 21 at 02:51

LIB version 9.5.0 for .net 4.5

(Jul 21 at 02:46) nh0kbstupid

What happens if you don't URL encode your parameter names (that is, instead of %2F us the / character)?

Also how about explicitly setting the HttpVerb property of the request object to "POST"?

link

answered Jul 21 at 17:22

jpbro's gravatar image

jpbro ♦
1.1k2618

I don't think so, because i use that parame for http post live of addon it working, but onlu i change content type so it doesn't working. I don't know how but i think only problem of content type not parame

(Jul 22 at 02:37) nh0kbstupid

Another example i post parame for new website where not detected content type it's working @@ hmmmmm

(Jul 22 at 02:42) nh0kbstupid

ok, i found error. http.FollowRedirects = false; if i set true it's not working, because when we receive Status Code 302 or 301 it will Auto redirect but it not delete parame when we using post. so it will get new website with parame behind , it's wrong

(Jul 22 at 13:46) nh0kbstupid

ok, i got new problem, when i add http.autoredirect. it show : GET /account/login.jsp?_requestid=241874&_dyncharset=ISO-8859-1 &_dynSessConf=4854342059940592074&/atg/userprofiling/ProfileFormHandler.value.login=email%40email.com&_D:/atg/userprofiling/ProfileFormHandler.value.login=%20&/atg/userprofiling/ProfileFormHandler.value.password=1234567&_D:/atg/userprofiling/ProfileFormHandler.value.password=%20&newStrongPassword= &_D:newStrongPassword=%20&loginAttemptsOverThreshold=true &/atg/userprofiling/ProfileFormHandler.login=Submit &_D:/atg/userprofiling/ProfileFormHandler.login=%20 &/atg/userprofiling/ProfileFormHandler.employeeProfile= &_D:/atg/userprofiling/ProfileFormHandler.employeeProfile=%20&/atg/userprofiling/ProfileFormHandler.refererURL=https%3A%2F%2Fwww.neimanmarcus.com%2Faccount%2Flogin.jsp%3F_requestid%3D193974 &_D:/atg/userprofiling/ProfileFormHandler.refererURL=%20&/atg/userprofiling/ProfileFormHandler.refererURL=http%3A%2F%2Fwww.neimanmarcus.com%2F &_D:/atg/userprofiling/ProfileFormHandler.refererURL=%20&_DARGS=%2Fpage_rwd%2Faccount%2Flogin.jsp&_DARGS=%2Fpage_rwd%2Faccount%2Flogin.jsp HTTP/1.1 it's wrong. how to delete when auto redirect on?

link

answered Jul 22 at 13:09

nh0kbstupid's gravatar image

nh0kbstupid
11

edited Jul 22 at 13:11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: Jul 20 at 17:34

Seen: 342 times

Last updated: Jul 22 at 13:46

powered by OSQA