none
HTTPREQUEST 400 RRS feed

  • Question

  • We've created excel macro program to use HTTPREQUEST to below link

    https://whqdfed.com:9031/as/token.oauth2

        envelope = envelope & "grant_type=" & "authorization_code" & "&"
        envelope = envelope & "code=" & auth_code
        
        
        
            XMLHTTPREQUEST.Open "POST", Url, False
            XMLHTTPREQUEST.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
            XMLHTTPREQUEST.setRequestHeader "Content-Length", Str(Len(XmlText))
            XMLHTTPREQUEST.setRequestHeader "Authorization", "Basic VkxQOjFMZlpvSmlQczZBME9RMkY1UlRqV2RmMjI4ZHhBckVkcDlvdGFoRVVxZ3NvMWJVM2NEdXJXR2FvVlJtVnI0Q2
            XMLHTTPREQUEST.send envelope
            XMLHTTPREQUEST.waitForResponse

    It is working fine in Windows 10 .

    However, when we run this excel macro in Excel 2016 for windows server, error " bad request" pops up.

    Is there way to solve error "400 BAD REQUEST"  ? We have killed all the backgrounds INTERNET EXPLORER in this server before we run the macro


    • Edited by Wicky Tse Wednesday, April 26, 2017 6:58 AM
    Wednesday, April 26, 2017 6:57 AM

All replies

  • Per “400 BAD Request”, it seems there is something in the parameter. I would suggest you try Fiddler to capture the requests both in Windows 10 and Server and compare the difference between them.

    I suggest you try to use Fiddler to send the request which works in windows 10 to check whether it will work.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 27, 2017 5:43 AM