Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
HTTP Frameworks setup - resource manager
Going by the resultant output from the /api 'authorization' . Do all APIs you create have to be registered here?
Not quite sure I get the meaning of/How used:
Resource ID
Property
Not quite sure I get the meaning of/How used:
Resource ID
Property
Comments
A resource ID is a unique identifier to a resource. Hence, if your resource is "customer" then a resource ID would be something like "1234".
The endpoint of a resource would look like:
api\customer
The endpoint of a resource ID would look like:
api\customer\1234
A property is just a way to requesting a specific attribute (aka property) related to a resource. These aren't used very often. For the sake of illustration, let's say you wanted the provide an endpoint to the name of the customer. The endpoint of the property would look like:
api\customer\1234\name
I have:
in postman I do http://localhost/api I see JSON returned as below. I was expecting to see my newly added 'resource' thisisatest.
{ "_links": { "self": { "href": "http://localhost/api" }, "webaccounts": { "href": "http://localhost/api/webaccounts", "title": "Web Accounts" }, "contacts": { "templated": true, "href": "http://localhost/api/contacts{?first_name,last_name,state}", "title": "Contacts" }, "version": { "href": "http://localhost/api/version", "title": "API Version" }, "ping": { "href": "http://localhost/api/ping", "title": "Ping Test API" }, "oauth": { "href": "http://localhost/api/oauth", "title": "OpenAuthorization" } }, "_forms": { "resetPassword": { "method": "PATCH", "action": "http://localhost/api/webaccounts/test/password", "title": "Reset Password", "fields": { "value": { "default": "", "required": true, "visible": true } } } } }
..where is "_forms" coming from?
The _forms content is being generated by the entry point API. You can read about it in the how do I add hypermedia controls to a resource? article.
The Voodoo magic of caching never seems to work the way I want/expect so I always found it good practice to restart the Windows Service when making pretty much any change to endpoints....
Yes and assume so as i would not be able to recall the info, I assume apply is a save as well.
Sorry, just pursing this as I know this version is sort of new and just letting you know in case it is a bug.
So, I think we may as well close the issue.
Equ CacheTTL$ to 300 ; // Allow cached data to only be fresh for 5 minutes.
Like I said, I restart the service (or rather a debug mode command). I have a hotkey to trigger a window's .cmd file after any endpoint changes. This kils and and restarts the debug engine. Only takes few seconds when you get used to it.
basically this:
REM Don't forget to stop the Window's OEngineServer Service before debugging and restart it when finished. REM Kill any previous sessions taskkill /fi "WINDOWTITLE eq OEngineServer" REM Delay a few seconds for the kill to finish ping localhost REM Set the title of this window so we can find it. This should be unique. TITLE OEngineServer REM REM Get the date and time REM For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b) CD /D C:\OPTO\OPTO REM #Java -jar OESocketServer.jar -l eserver.cfg -d 3 > "oesocketserver_debug_test_%mydate%_%mytime%.txt" Java -jar OESocketServer.jar -l eserver.cfg -d 3 REM Use this if you need to see why the console closed REM pause