Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Understanding web services

    Hello everyone..

    I have a couple of queries regarding the webservices.

    I have used the Yahoo! Maps and the Google Maps API. Though neither of really require any server side scripting, Yahoo! offers a REST based service where if you send a URL with an address in it, and you get back an XML file containing detail about the zip code. The XML could then be parsed using something like the SimpleXML module of php. I simply used fopen to open the URL and sent the contents of the opened file into another file and that file had the XML details returned.

    However, what I want to learn is how to establish connectivity with a server and send stuff. Here is a typical example
    http://code.blogger.com/archives/atom-docs.html

    It says to post a blog, send the following:
    To create a new entry:

    POST /atom/3187374 HTTP/1.1
    Content-type: application/xml
    Host: www.blogger.com
    Authorization: BASIC c3RldmVqOm5vdGFyZWFscGFzc3dvcmQ=

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <entry xmlns="http://purl.org/atom/ns#">
    <title mode="escaped" type="text/plain">atom test</title>
    <issued>2004-04-12T06:07:20Z</issued>
    <generator url="http://www.yoursitesurlhere.com">Your client's name here.</generator>
    <content type="application/xhtml+xml">
    <div xmlns="http://www.w3.org/1999/xhtml">Testing the Atom API</div>
    </content>
    </entry>


    Can the above be done using PHP? What module do we need? A big question of mine, what is the long complicated string that comes after the BASIC part in the Authorization section?

    Even the del.icio.us API is somewhat similar, and requires HTTP-Auth. Now what is that? How do I send that through PHP?

    In other words, is this in anyway following the ideas of REST? How do I send this "file" (assuming I am write the entire data into a file)? Next, how do I "send" it to the server?

    By the way, is this what is XML-RPC?

    Any help with this, please?
    Last edited by harisund; 01-04-2006 at 09:54 PM.

  • #2
    New Coder
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Best way to go is to use cURL to send and recieve GET or POST requests to other servers


  •  

    Posting Permissions

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