Alan,
Rest is more of an architectural style than a protocol. It should just be the plain HTTP protocol but could include WEBDAV methods above the usual GET/PUT/POST/DELETE. Rest describes how you make use of URIs to identify resources (things) instead of methods (procedures). When you see verbs in URIs that's a code smell that the interface is not really Restful.
I'd push back at the consultant that the 500 response generated by the server isn't very helpful. Why isn't it a response in the 4xx range or one of the other 5xx errors. 500 is the default server error if there is nothing else available.
Paul Morgan
Principal Programmer Analyst
IS Supply Chain/Replenishment
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Thursday, August 12, 2010 5:28 PM
To: RPG programming on the IBM i / System i
Subject: Programming to Rest Server
I am using Scott's HTTP Api to attempt to write to a Rest Server.
In all the previous projects that I have done using this api, the targets
where outside the company servers but this server was created by a
consultant and he tells me that it is a Rest Server.
I am using the HTTP_Url_Get_XML to send the following
http://cre-freitrater:8080/cre_freitrater/rest/freitrater/1
The request chain that is being sent to it looks like the following:
GET /cre_freitrater/rest/freitrater/1 HTTP/1.1 Host: cre-freitrater:8080
User-Agent: http-api/1.23
I am getting back a 500 response saying that there was an internal server
error.
I can type the same string (the first string) into the browser and it runs
without a hitch.
This is probably a Scott question but what has to be done different for REST
server than a regular HTTP server?. According to what I have read it just
uses regular HTTP protocols.
Can anyone point me to an article on writing a Rest Client in RPG?
Any help would be appreciated.
As an Amazon Associate we earn from qualifying purchases.