How To Get JSON format data from webapi..even the webapi return PDF format in AngularJS ?

Posted by Kasani007 under AngularJS on 8/21/2017 | Points: 10 | Views : 433 | Status : [Member] | Replies : 4
How To Get JSON format data from webapi..even the webapi return PDF format in AngularJS. Is There Any way to get json data instead of PDF format from webapi ?




Responses

Posted by: Sheonarayan on: 8/21/2017 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
By default, ASP.NET Web API return JSON format. See that your Web API method return JSON.

Read this post http://techfunda.com/howto/562/http-get-server-request.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kasani007 on: 8/23/2017 [Member] Starter | Points: 25

Up
0
Down
Hi Sheo Narayan,
Thankyou for your response.

Actually It Is Not My WebApi That I Am Using, It Is A Third Party WebApi. When I call it from Postman, it is asking to save the PDF.
My Requirement is not Saving PDF file, i need the data in json format...how can i manipulate to get the data in json but not in pdf format.

is there any way to convert the response to JSON format, if it is in any other format like pdf.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay2707 on: 8/29/2017 [Member] Starter | Points: 25

Up
0
Down
As Mr. Sheo Narayan suggested, webapi by default in json or xml (now a day json is used more than xml). So the issue is in your postman response format.

Check this link of postman - https://www.getpostman.com/docs/postman/sending_api_requests/responses
In the response, may be you set pdf rather than json.

If you still not satisfy, then try restclient in firefox add-on "chrome://restclient/content/restclient.html"
There are so many tool available, so don't bother that pdf response you get when actual implementation.

So conclustion is Webapi will give you json, but this third party tool gives you option to set the output format, simple.

Happy coding.


Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Siddydv27 on: 11/15/2017 [Member] Starter | Points: 25

Up
0
Down
So great play jumblesolver game so https://jumblesolver.online fast play online site.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response