1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

get data from xml api

Discussion in 'XenForo Development Discussions' started by gaga, Jan 2, 2016.

  1. gaga

    gaga Member

    Hi to all,
    I have one question.
    In my case i need to make variable who reads from external xml file.
    I want to read from https://cloud.google.com/storage/docs/xml-api-overview

    btw I have acp option (default set up)

    I learn php programming and i realy need help with ex. to understand this.

    Thanks to all.
  2. gaga

    gaga Member

    or any add-on who use xml? i'll see code.

    Thank you
  3. Robust

    Robust Well-Known Member

    I use json requests to APIs usually or directly interacting with curl, never had to use XML.

    You'd create a SimpleXMLObject (off memory, I've only really had to do it a few times) and set/modify attributes. Could send the request using XenForo_Http_Client which uses Zend's http client, or simply by using curl.

    Essentially, you'd do it here the same way you'd do it anywhere else. Zend has nothing for XMLs I believe. You can look though, library/Zend or library/XenForo/Http. Could search stackoverflow too on how to do it generally in PHP, as I guess that's what you'll be doing.

    I'm on a phone now so I can't really help much more, but if there isn't any class to help, create the XML request as normal and then send it using the HTTP client.
    gaga likes this.
  4. gaga

    gaga Member

    thank you sir,
    i'm a beginer in programming, please give me ex. how to use with json.

Share This Page