Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in response values in the preview tab and response tab, Chrome network devtools

I'm trying to get started with API Instagram Basic Display. Оne of the steps (#5) is to get an access token by making a post request to API

...Upon success, the API will return a JSON encoded object containing a short-lived Instagram User Access Token, valid for 1 hour, and your Instagram test user’s ID...

Using Angular HttpClient, I receive the token and ID. Token is OK, but user ID value differs by one from the correct value. User id value consists of 17 digits. For example real id is: 12345678981234567, and I receive 12345678981234566

The same situation is when viewing user ID in developer tools in chrome Network->Preview tab - the value is one less than the real, but in the Network->Response tab the value is correct. MS Edge - a similar problem: in dev tools enabling "pretty print" in Response tab decreases the actual user ID value by one. chrome preview tab, chrome response tab, edge - pretty print disabled, edge - pretty print enabled.

While sending a request through postman, the answer comes with the correct value. postman

Please tell me what is the reason for this behavior, and is there any way to avoid such problems? Thank you

like image 557
Xander_UZZZER Avatar asked Feb 19 '20 14:02

Xander_UZZZER


People also ask

What is the use of preview tab in dev tools?

# Preview feature: New Performance insights panel Open the panel and start a new recording based on your use case. For example, let's measure the page load of this demo page. Once the recording is complete, you get the performance insights on the Insights pane.

What is preview in Chrome DevTools?

On Chrome DevTools, here are the top features: A device preview to test your webpage's responsive design. A JavaScript debugger to identify and fix bugs. A network panel to track and analyze page requests.

What is the difference between transferred and resources in Chrome DevTools network tab?

"Transferred" is the compressed size of all resources. You can think of it as the amount of upload and download data that a mobile user will use in order to load this page. "Resources" is the uncompressed size of all resources.


1 Answers

This is because that javascript max safe integer is 9007199254740991 and your id is greater than that. To get the correct value you need to change it to string.

like image 137
Samim Hamza Avatar answered Jan 03 '23 23:01

Samim Hamza