GET Examples – db.org/sops/3/experimental_conditions/55 db.org/sops/3/experimental_conditions/55...
-
Upload
adrian-norman -
Category
Documents
-
view
212 -
download
0
Transcript of GET Examples – db.org/sops/3/experimental_conditions/55 db.org/sops/3/experimental_conditions/55...
GET
• Examples– http://seek.sysmo-db.org/sops/3/experimental
_conditions/55
– http://www.pathwaycommons.org/pc/webservice.do?cmd=get_pathways&version=2.0&q=O14763&input_id_type=UNIPROT
Configuring GET
• Signature
• Content Type / (Accepts header)– application/xml– application/json– text/csv
Signatures
• http://seek.sysmo-db.org/sops/{sop_id}/experimental_conditions/{exp_cond_id}
• http://www.pathwaycommons.org/pc/webservice.do?cmd=get_pathways&version={version}&q={q}&input_id_type={type}
Created Service
Get_Exp_Conditions_For_SOP
sop_id exp_cond_id
body status Redirection
Outputs
• Body– The http response from the service, according to the
content type• Status
– The HTTP status code• 200 – OK• 301,302,303 – redirects (more to come on this)• 401 – Unauthorised• 404 – Not found• 500 – Server Error
• Redirection– URI of last redirection
Handling outputs
• XML response– Handle with XPath
• Enhance xpath support• Embed within Rest processor??
– PRO: Avoids splitter problem– CON: Better xpath support may be useful regardless of
rest
• JSON– Handle with JSON path– Not sure if this is needed
Redirection
• Redirection may occur due to linked data compliance, or because the resource has moved.
• 301 – Moved permentantly• 302 – Found• 303 – See other (linked data)• 304,305,306,307 (see spec)• Body response is that of the final redirection ??• Status is of the final redirection ??
PUT/POST
• PUT – Update a resource
• POST – Create a resource
• Can’t always rely on this being true
Configuring PUT
• Signature– http://seek.sysmo-db.org/sops/{sop_id}/experi
mental_conditions/{exp_cond_id}
– Content type• application/xml• application/json• text/csv
2 ways of updating
• With parameters– http://seek.sysmo-db.org/sops/{sop_id}/
experimental_conditions/{exp_cond_id}?measured_item={item}&value={value}
• With request body<xml? …><exp_condition>
<measured_item>PH</measured_item><value>8.7</value>
</exp_condition>
Created Service
Update_Exp_Conditions_For_SOP
body sop_id exp_cond_id
body status redirection
Configuring POST
• Signature pretty much the same– http://seek.sysmo-db.org/sops/{sop_id}/
experimental_conditions/
• Once again content type– Application/xml– etc
Once again, 2 ways of creating
• With parameters– http://seek.sysmo-db.org/sops/{sop_id}/
experimental_conditions/?measured_item={item}&value={value}
• With request body<xml? …><exp_condition>
<measured_item>PH</measured_item><value>8.7</value>
</exp_condition>
Redirection of POST
• Redirection is most important for POST as it provides the identifier for the new resource.– E.g after creation may get redirected to
http://seek.sysmo-db.org/{sop_id}/experimental_conditions/{new_exp_condition_id}
• Can’t always rely on it – need to know the service – Sometime there is not redirection and just the content
type of the new resource is returned in the response body
DELETE
• Deletes the resource based upon identifier
• Tends to redirect back to the list of resources of that type.
• Just needs the signature to configure
Questions to users
• What to call the body inputs/outputs– Body, response, request_body,response_body
• Should we make the body inputs/ouputs configurable for POST/PUT
• Should redirection stuff be hidden from the user, and optionally visible?
• Built in XPATH support, or separate?• Tools to help provide XML body inputs for
PUT/POST– Beanshells & templates.