Can a REST API be used within a Web API service?

minman0615

New member
Joined
Mar 7, 2019
Messages
1
Programming Experience
Beginner
I need to create a Web API "wrapper" that is consumed by a client, but in this Web API Service, I actually need to create a POST request to a different REST API service that is running on the same IIS server that does some work and returns StringContent that I pass back to the client via a JSON HttpResponse. Is this possible? Instead of the client making direct calls to the actual REST API and returning data they don't need/want, they would call my Web API service and I would only return them the required data. I know this was done in the old SOAP WSDL model.
If I need the client to pass in a couple parameters that are required for my POST request, would I be having the client use a GET or POST request?
 
I haven't actually done what you're suggesting but I can't see any reason that it would not be possible. Calling the REST API from your Web API app would be just like calling it from any other app.
If I need the client to pass in a couple parameters that are required for my POST request, would I be having the client use a GET or POST request?
It could be either but, if they are basically filters for a query then you would usually use GET.
 
Back
Top Bottom