jeudi 23 juin 2016

Curl returning the http response of json by escaping the forward slash

I am trying to build REST Api in laravel and my API returns a download link of file as json response. However I am stuck with an issue while accessing the api via Curl. I have used json_encode with JSON_UNESCAPED_SLASHES as well while creating a response but that did not work. The API works fine with httpie CLI but it adds escape character for forward slashes.

gaurav@debian:~$ curl -i -w "\n" http://ift.tt/28ZbUEr

Curl Output from Command Line: "http://ift.tt/28Tfgeh"

gaurav@debian:~$ http http://ift.tt/28ZbUEr

HTTPie Output from Command Line: "http://ift.tt/28Tfgeh"

Can someone let me know if I have to provide some additional parameter to format the JSON output properly to unescape the forward slash ?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28ZbwWs
via IFTTT

Aucun commentaire:

Enregistrer un commentaire