Http submit button calling REST API

Avatar

Avatar

AEM_USER1

Avatar

AEM_USER1

AEM_USER1

25-01-2021

Ok so i have my REST API in iis. for testing based on @workflowuser advice was to use an HTTP submit button. so I built something simple. I hardcoded the REST API call and when i click the button I get...Capture.JPG

an http 405 error.

 

Capture1.JPG

 

@workflowuserdo you have any examples on how to actually build the call to a GET rest api? and lastly i would like the response to be into that textfield. Please help I am at a lost.

Accepted Solutions (0)

Answers (4)

Answers (4)

Avatar

Avatar

AEM_USER1

Avatar

AEM_USER1

AEM_USER1

27-01-2021

@GirishBedekar with the response I intent to prefill my pdf. We are not using adaptive forms for this. Just pdf. 

 

So REST API cannot be use with PDFs? 

Avatar

Avatar

GirishBedekar

Avatar

GirishBedekar

GirishBedekar

26-01-2021

Yes http post is for submitting the pdf form

What do you intend to do with the response you get from the REST call?

have you considered using adaptive forms instead of pdf form

Avatar

Avatar

AEM_USER1

Avatar

AEM_USER1

AEM_USER1

26-01-2021

@GirishBedekar the use case is just to get a JSON String from a database. I wanted to use REST API instead of SOAP web service. I also wanted to use Workbench but I do not see a way for workbench to return a JSON string unless it is programming it with JAVA servlets.

 

So using a HTTP submit button is only for POST? not GET? please advice

 

Thanks

Avatar

Avatar

GirishBedekar

Avatar

GirishBedekar

GirishBedekar

25-01-2021

I am not sure on how to populate fields on the form using REST endpoint response 

what is your use case?