0

I have created resources for GET, POST, PUT, DELETE using REST convention. I want to use it.

Please let me know, how to use the resource which I have created.

ciscoheat
  • 3,719
  • 1
  • 35
  • 52
RCS
  • 1,370
  • 11
  • 27
  • Post the command you used to initialize the resource extension. – wst Jun 16 '16 at 14:47
  • I have registered the sjs file using following command - curl --anyauth --user userName:password -X PUT -i -H "Content-type: application/vnd.marklogic-javascript" --data-binary @./getExample.sjs 'http://localhost:8500/LATEST/config/resources/get-example' – RCS Jun 16 '16 at 14:56
  • Resource extensions are installed at `http://host:port/version/resources/extensionName`, so yours should be accessible at `http://localhost:8500/LATEST/resources/get-example`. – wst Jun 16 '16 at 15:18

1 Answers1

2

I am not sure what you mean by using the resource while querying the database. The resources are separate calls, as documented at https://docs.marklogic.com/guide/rest-dev/extensions#id_13882. What exactly do you want to do? What is in your GET resource, for example?

TJ Tang
  • 921
  • 6
  • 17
  • Thanks for reply. I have created resource and added http headers . I wanted to use the created resource while searching the element. I have created one transform function instead that did the job for me. – RCS Jun 16 '16 at 14:33