Questions tagged [json-response]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
85 views

How to set content-type header as JSON in controller Magento 2.3

I am having the controller which is responding with resultJson(\Magento\Framework\Controller\Result\JsonFactory), I have given setData. And I need to set header as JSON. I want the JSON result in the ...
0
votes
1answer
41 views

How to send 'alert' from controller in json?

I am currently trying to stop redirecting to product view page if someone forgets to select configure option and click on 'add to cart', instead of that it will just send popup message or alert. Here ...
1
vote
0answers
26 views

In Magento 2.3, How to add custom error code with response

In Magento 2.3, How to add custom error code along with response. For example, If I add the code as below, I am getting this below response: throw new InvalidEmailOrPasswordException(__('Invalid ...
0
votes
2answers
20 views

Magento1.8 - Restapi Custom Module - Return variable formatting issue

This is my first post so please let me know if I missed sharing any detail on my problem. I have below files ready in Magento kept in app/code/community: A. Autogen > Restapi > etc > api2.xml B. ...
2
votes
3answers
143 views

How to use \Magento\Framework\Controller\Result\JsonFactory for Magento 2.3?

This post is related to this Magento2 - How to get JSON response from Controller What I am trying to do is to format the json response of my custom web API, but it seems \Magento\Framework\Controller\...