我在IOS应用程序中获取针对地图框api请求的http代码304状态代码.但是它可以在Chrome,Safari,Firefox等浏览器中使用200条代码.也可以在Android中使用.
I am getting http code 304 status code for the map box api request in IOS application. But it works in browsers such as Chrome, Safari, Firefox getting 200 code. Also works in Android.
api.mapbox/styles/v1/mapbox/streets-v9?access_token="my token" 推荐答案304状态代码保持未修改"状态,表示设备(例如浏览器或IOS应用)识别出已存在的内容.这意味着它已被缓存,可以从那里进行服务,而无需再次下载.状态304并不是坏事"或错误",就像您在问题中描述的那样.
The 304 status code stays for "not modified" meaning that the device (e.g. a browser or your IOS app) recognizes the content as already present. This means that it is cached and can be served from there and does not need to be downloaded again. Status 304 is not "a bad thing" or "wrong", like you describe it in your question.
我想您在IOS应用程序中会得到304,因为您没有禁用缓存,而在浏览器开发人员工具中,您可能只是勾选了禁用缓存"框.然后,您将始终获得最新的200条回复.如果您取消选中此框,那么您还会在该处看到状态304
I guess you get 304 in your IOS app because you don't have caching disabled where as in your browser developer tools you might have just ticked the "Disable Cache" box. Then you will always get fresh and new 200 responses. If you would uncheck the box you will also see status 304 there too
您可能想在这里更深入地了解一下: httpstatuses/304
You might wanna take a more in depth look here: httpstatuses/304
更多推荐
为什么mapboxgl api返回304状态代码?
发布评论