+ Reply to Thread
Results 1 to 6 of 6

produce JSON code and POST to website

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    brussels
    MS-Off Ver
    Excel 2010
    Posts
    4

    produce JSON code and POST to website

    I got a string in cell B7 on page Open1 : {"mType":"OPEN","systemOwnerId":1,"systemId":2,"quantity":5,"autoSync":false,"symbol":"BAR"}
    I expected it to be easy to send that code to a website as follows :
    Please Login or Register  to view this content.
    and find the website's answer in "sHTML",
    but the website expects a json format, while i probably just send some text ...

    Does anyone know how to transorm this text in real json (in excel or vba)
    and which command i need to send that json to the website ?
    Thanks a lot !
    Last edited by jefjef; 01-10-2014 at 07:03 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: produce JSON code and POST to website

    JSON is text. As far as I can see, other than not waiting for a response that code should work,

    Ps. You should also edit your post to put your code in tags as per the forum rules

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    brussels
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: produce JSON code and POST to website

    Answer from website is "Error 406 Not Acceptable"
    ps : sry but i really dont understand what you mean with your ps

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: produce JSON code and POST to website

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  5. #5
    Registered User
    Join Date
    04-09-2013
    Location
    brussels
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: produce JSON code and POST to website

    Anyone who can help please ???
    Last edited by jefjef; 01-10-2014 at 07:05 AM.

  6. #6
    Registered User
    Join Date
    04-09-2013
    Location
    brussels
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: produce JSON code and POST to website

    Problem is solved thanks to a reaction of the website owners :
    in the JSON i've sent, i forgot 1x a "
    en the lin e
    oHttp.setRequestHeader "Accept", "application/json"
    must be deleted, or replaced by
    oHttp.setRequestHeader "Accept", "*"

    Makes it to work perfectly !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Use XMLHTTP to log on website and then post data
    By tonyibm in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-19-2013, 09:03 AM
  2. [SOLVED] VBA Code to Produce Multiple Pie Charts (data in columns)
    By Janc in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-30-2012, 06:48 AM
  3. POST data form submission to website
    By bigsmooth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2010, 04:37 PM
  4. manipulating code and adding code to produce pdf
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2008, 01:47 PM
  5. produce a formulate to produce assigned seats for dinner
    By DavidJoss in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-03-2005, 10:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1