Results 1 to 1 of 1

Thread: Why does python keep reverting to application/x-www-form-urlencoded

  1. #1

    Joined
    Jun 2012
    Posts
    1,699
    Thanks
    876
    Thanked
    2,881/1,142
    DL/UL
    44/1
    Mentioned
    562 times
    Time Online
    118d 6h 45m
    Avg. Time Online
    40m

    Why does python keep reverting to application/x-www-form-urlencoded

    I am trying to send a json encoded post url so I have simplified my code for easy viewing..

    PHP Code:
        def post_json(selfurldatareferer ''readable True):
            if 
    referer == '':
                
    referer self.lastpage
            self
    .opener.addheaders = [('Content-Type''application/json')]


            
    encodeddata json.dumps(data)

            
            
    res self.opener.open(url, (encodeddata ))


            
            
    self.lastpage res.geturl()
            if 
    readable:
                return 
    self.readable(res)
            else:
                return 
    res 

    However when I make the request , I just get this:




    Anyone know why this is? I have been awake for 30 hours so im hoping its something simple lol.

    Here is the full request without everything stripped out:
    Last edited by DarkByte; 03-11-2014 at 02:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •