How to check full body/header of HTTP Request?


#1

Hi,

I want to know if this is possible to check/read the full header/body of HTTP Request made in the code ? May be developers have some tools or something to debug that request ?

Thank you
Regards
ZH


#2

@zeeshanhashmi if you’ve previously worked with JavaScript you might be familiar with Chrome DevTools. We’ve put effort into enabling most of the functionalities to work in NativeScript. You can read the article on debugging in the official docs - https://docs.nativescript.org/tooling/chrome-devtools#network (Network debugging not supported on iOS as of 3.1, but it is available should you approach debugging your NS iOS app with safari)


#3

Actually I am trying to get my users authenticated based on a different script then “https://api.everlive.com/v1/GWfRtXi1Lwt4jcqK/

For this purpose, I put below line in “login.service.js” in the Sample Groceries application in native script GitHub.

I then tried to login and it prints the data in the terminal. Now I copied that data and put it in a php file to return the same json data, then I changed the backend api url on line no. 28 in “login.service.js” then tried to login but it failed. Even it did not show anything on Terminal window. As I have console,.log command.


#4

Well, I have managed to do it my self !


#5

Hi there, i’m using Google Chrome Developer Tools and works ok, for my backend I’m currently using CodeIgniter but same problem to read JSON objects, so I found https://stackoverflow.com/a/2731431 wich says that on my backend controller I must use:

$input_data = json_decode(trim(file_get_contents('php://input')), true);

print_r($input_data['username']);

Result:

Array
(
[username] => israel@codevelopit.com
[password] => 123456
[grant_type] => password
)

at the moment it’s what I got!