format of web api respons is not correct - asp.net-web-api

request is present "accept: application/xml; charset=utf-8" but response content is json
Request:
Connection: Keep-Alive
Accept: application/xml; charset=utf-8
Content-Type: application/xml; charset=utf-8
Response:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 07 Jan 2019 17:11:14 GMT
Content-Length: 31
{"cod":1,"msg":"","data":"100"}

software is developerd with .net framework 4.6.1
I noticed that if I return an anonymous class this will be serialized in json and never in xml.
to solve the problem, just return a non-anomalous calsse and it will be serialized correctly.

Related

AWS Cloudfront cache MISS with AWSALB cookie

I have a wordpress website with a setup on EC2, ALB, Cloudfront and varnish. On chrome dev toolbar, I got a problem that cloudfront cache always MISS for document/html type but HIT for the static files like js, css, png, etc. I found on the response header (for document type only) there is a cookie (I believe) from ALB like this :
set-cookie: AWSALB=U5AWJwh/v3MaAYRDCdFicDCuiWi9Fy14fiegh0DG2UwTIq5zToBRCrpUO7nqqj2mI5XRcbu9pINYxv0XhmjVC5T2swGCP8RzeAJLrOwy3NLPRB/nJSJD/ng5Iy/0; Expires=Thu, 12 Dec 2019 03:50:07 GMT; Path=/
I tried to solve this on the cloudfront cache behaviour setting, then I set :
Whitelist Cookies: AWSALB=*
After waiting a few minutes to let the cloudfront cache refreshed, I tried to load the website but I still got a response 'MISS' for x-cache. How to solve this problem.
Here is the response and request header for the MISS cache:
General:
Request URL: https://yyy.com/
Request Method: GET
Status Code: 200
Remote Address: zzz:443
Referrer Policy: no-referrer-when-downgrade
Response Header:
accept-ranges: bytes
age: 0
cache-control: max-age=3299, public
content-encoding: gzip
content-length: 39955
content-type: text/html; charset=UTF-8
date: Thu, 05 Dec 2019 01:21:07 GMT
etag: "92d49bdbffc17d570120a667c34465a6"
expires: Thu, 05 Dec 2019 02:16:06 GMT
last-modified: Thu, 05 Dec 2019 01:16:06 GMT
link: <https://yyy.com/wp-json/>; rel="https://api.w.org/"
link: <https://yyy.com/>; rel=shortlink
pragma: public
server: nginx/1.16.1
set-cookie: AWSALB=7zzIXUQ/O9X6+vce8GWOs1x1ES9/nr7r5/Hc06xmWL5GDMVLeaUJututZeBJf7TVIHdbXmOZgAhvYtkQva9y/bFPi2EPdn3j5MqqbSOiPs+qS+9adILQ95csWH+/; Expires=Thu, 12 Dec 2019 01:21:07 GMT; Path=/
status: 200
vary: Accept-Encoding
via: 1.1 varnish, 1.1 f92e2b771ebc524db2f478f72162e565.cloudfront.net (CloudFront)
x-amz-cf-id: EmCMRJ9cQ6zs0N4tvHAEOZxC1l6vYMIqBTA6hTVlqsxuKj275VRNLQ==
x-amz-cf-pop: SIN5-C1
x-cache: Miss from cloudfront
x-varnish: 339894892
Request Header:
:authority: yyy.com
:method: GET
:path: /
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9,id;q=0.8
cache-control: no-cache
pragma: no-cache
sec-fetch-mode: navigate
sec-fetch-site: none
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
and here is the response and request header for the HIT cache:
General:
Request URL: https://yyy.com/wp-content/cache/minify/db66e.css
Request Method: GET
Status Code: 200
Remote Address: zzz:443
Referrer Policy: no-referrer-when-downgrade
Response Header:
accept-ranges: bytes
age: 630787
cache-control: max-age=31536000, public
content-encoding: gzip
content-length: 100500
content-type: text/css; charset=utf-8
date: Wed, 27 Nov 2019 18:08:00 GMT
etag: "pub1574872585;gz"
expires: Thu, 26 Nov 2020 18:07:58 GMT
last-modified: Wed, 27 Nov 2019 16:36:25 GMT
pragma: public
server: nginx/1.16.1
status: 200
vary: Accept-Encoding
via: 1.1 varnish, 1.1 f92e2b771ebc524db2f478f72162e565.cloudfront.net (CloudFront)
x-amz-cf-id: -8otMvG_QhBrVBVH8HD0AuzsTwny_o7QkDuQnZnHHqcmqriLuAw_Lw==
x-amz-cf-pop: SIN5-C1
x-cache: Hit from cloudfront
x-varnish: 1158322228
Request Header:
:authority: yyy.com
:method: GET
:path: /wp-content/cache/minify/db66e.css
:scheme: https
accept: text/css,*/*;q=0.1
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9,id;q=0.8
cache-control: no-cache
cookie: AWSALB=7zzIXUQ/O9X6+vce8GWOs1x1ES9/nr7r5/Hc06xmWL5GDMVLeaUJututZeBJf7TVIHdbXmOZgAhvYtkQva9y/bFPi2EPdn3j5MqqbSOiPs+qS+9adILQ95csWH+/
pragma: no-cache
referer: https://yyy.com/
sec-fetch-mode: no-cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Thanks.

Applozic Platform Chat API - Uploading message attachments

I'm integrating with applozic for a client, and I need to send messages with attachments to users. I'm following the steps here: https://docs.applozic.com/docs/1-1-user-chat-and-group-chat-api#section-send-message-with-attachment on how to do this.
I'm having trouble with step 2:
Step 2. Call Url With multipart :
Call API with your file object attached to files[] array:
the requests I send are rejected with a 405 error, for example....
Request:
POST /_ah/upload/AMmfu6ZQrGP3Szfk1GuQAb_2a3J7PPWhQoiRbTnEjLp2MIzpuoeHrYryXhlzI6NW9JikjpJbT-HEtHAIk3og-Gl5EesCzBASipgtq1Hvh-PN90sjvasjRBvtO5XIFWi08gGfqTYUNT0C/ALBNUaYAAAAAWocIx4JPtA2a7LU00w1_pRui2Q3NjLR5/
application-key: XXXX
authorization: Basic XXXXX
cache-control: no-cache
accept: */*
host: applozic.appspot.com
accept-encoding: gzip, deflate
content-type: multipart/form-data; boundary=--------------------------523557777486909202804628
content-length: 286288
--------------------------523557777486909202804628
Content-Disposition: form-data; name="file"; filename="attachment.pptx"
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
....file data....
Response:
HTTP/1.1 405
status: 405
x-guploader-uploadid: AEnB2UpLhLC9VKz0ysfP-WcNTgGCFc_67dVEp_-ANZsLTvWfEOFgyMWKKvpehGa3I6E9Q_s8S7LQAcYFlTt-J8LwVqRosha6lNros6eECUP5JdJ_RsZMW9g
access-control-allow-origin: *
access-control-allow-methods: POST, GET, OPTIONS, DELETE
access-control-max-age: 3600
access-control-allow-headers: UserId-Enabled, Authorization, Application-Key, Source, Content-Type
allow: GET
x-cloud-trace-context: 728352eed99001ff946db65f68daf518;o=1
x-appengine-estimated-cpm-us-dollars: $0.000026
x-appengine-resource-usage: ms=93 cpu_ms=605
date: Fri, 16 Feb 2018 16:29:37 GMT
pragma: no-cache
expires: Fri, 01 Jan 1990 00:00:00 GMT
cache-control: no-cache, must-revalidate
content-length: 0
server: UploadServer
content-type: text/html; charset=UTF-8
alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
Could someone tell me what i'm missing here? It's responding with allow: GET which doesn't make sense, am I failing auth somehow?
Is there any more documentation available on this feature?
Step 1. Get Url to Upload File
Call API:
https://applozic.appspot.com/rest/ws/aws/file/url?data=1478763491992
where data= currentTime in long
API Response String:
https://applozic.appspot.com/_ah/upload/AMmfu6YAZpXFUYvC7wqIcW7msh8-YF1d7Tsh1UOTSCzpx2vinrcLQRtVfWbFHHXLFunUqsSLe1dYsDbsJxIO28cNcGrECf7LfFaNSycct-Sybd9KAZWk0yk7HybzxbBp4YQEDmMLi4Uf/ALBNUaYAAAAAWovz3TcYX24yam5K3embIkgQ6Q1pGIRf/
Step 2. Call Url With multipart :
Call API with your file object attached to files[] array(Parameter:files[]):
https://applozic.appspot.com/_ah/upload/AMmfu6YAZpXFUYvC7wqIcW7msh8-YF1d7Tsh1UOTSCzpx2vinrcLQRtVfWbFHHXLFunUqsSLe1dYsDbsJxIO28cNcGrECf7LfFaNSycct-Sybd9KAZWk0yk7HybzxbBp4YQEDmMLi4Uf/ALBNUaYAAAAAWovz3TcYX24yam5K3embIkgQ6Q1pGIRf/
filetMeta json Response:
{"fileMeta":{"blobKey":"AMIfv96n1wlMLpa3R_1i4nbFc4L1RLG81W5RovnPqMhVspzzJv5WBbnYgI4uwZkNjvzszNqsWwEQU6mrYoYsaoa2Vhi45p3P7bvQhAO1ciEL1K1yZJ2HB-goYPULYumC7LA8h33p_Ry
JBewFK8FogMDPR4_4zjClIg","contentType":"image/png","createdAtTime":"1478763491698","name":"applozic.png","size":"8694","thumbnailUrl":"https://lh3.googleusercontent
.com/EfnmKkzLtwBgYQq9UWc26oVqSZUiGukhXQgq7ns9a3G53ZAveFOszamvsqD-tbOfuirqERBO0QR60xFgYiGr=s120"}}
Try this request :
Post request
Url:-
https://applozic.appspot.com/_ah/upload/AMmfu6ZB1z1BBDQMh_ztllvkde5mest9aFeqDHoSmCLzGH3vEtqQLKKOZG820ONgNCOc3BatKJL-59Tppm76zvyfw773R4lEa7m3gaM4cdKGbDU5oy8R_9zt_PT12j8xYSK2oh3rO3xa/ALBNUaYAAAAAWoq31zwU986GLyomPgxjoJb6qHuf4iIx/
Param:files[]

Creating Google Group contact

I am trying to create a group contact using Google Contacts v3.
Following the example, and testing within the OAuth 2.0 Playground, here is my sample code:
POST /m8/feeds/groups/default/full/ HTTP/1.1
Host: www.google.com
Gdata-version: 3.0
Content-length: 355
Content-type: application/atom+xml
Authorization: Bearer #{auth_code_goes_in_here}#
<atom:entry xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/contact/2008#group"/>
<atom:title type="text">Salsa group</atom:title>
<gd:extendedProperty name="more info about the group">
<info>Nice people.</info>
</gd:extendedProperty>
</atom:entry>
However, I keep getting the 400 error in the response:
HTTP/1.1 400 Bad Request
Alternate-protocol: 443:quic,p=1
Content-length: 236
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Transfer-encoding: chunked
Expires: Fri, 11 Mar 2016 05:18:06 GMT
Vary: Origin, X-Origin
Server: GSE
-content-encoding: gzip
Cache-control: private, max-age=0
Date: Fri, 11 Mar 2016 05:18:06 GMT
X-frame-options: SAMEORIGIN
Alt-svc: quic=":443"; ma=2592000; v="31,30,29,28,27,26,25"
Content-type: application/vnd.google.gdata.error+xml; charset=UTF-8
<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
<error>
<domain>GData</domain>
<code>invalid</code>
<internalReason>Entry does not have any fields set</internalReason>
</error>
</errors>
Any ideas what I am doing wrong here?
Further to this, I would like to create contacts in Google, with specific Group attached to it. Is this do-able from the 'creating contacts' method? I can't seem to find an example where I can specify the group directly to it.
Thanks for any suggestions.
Regards,
Leroy
After some painful research, I found the solution by changing the data from:
<atom:entry xmlns:gd="http://schemas.google.com/g/2005">
to
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">

WebApi 2.2 IIS 7.5 something is setting max-age

I have a .Net 4.5.2 WebApi 2.2 REST service. Windows 7 machine running IIS 7.5. It doesn't do much but return the current date/time. When hosted in IIS, I get response headers that look like this:
HTTP/1.1 200 OK
Cache-Control: max-age=60
Content-Length: 58
Content-Type: application/json; charset=utf-8
ETag: "c664145c-6923-44b6-b3fb-ff7e50259b44"
Server: Microsoft-IIS/7.5
ApplicationDate: Test with date 4/3/2015 3:18:08 PM
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 03 Apr 2015 19:18:10 GMT
{"messages":[],"result":"All is well 4/3/2015 3:18:07 PM"}
If I call it a second time, I see this:
HTTP/1.1 200 OK
Cache-Control: max-age=60
Content-Length: 58
Content-Type: application/json
ETag: "c664145c-6923-44b6-b3fb-ff7e50259b44"
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 03 Apr 2015 19:27:25 GMT
{"messages":[],"result":"All is well 4/3/2015 3:18:07 PM"}
My custom header (ApplicationDate) is gone, and the time hasn't changed. The key is probably the Cache-Control: max-age=60 in there. I don't know where it's coming from!
If I run it "Self Hosted", same code...I see this:
HTTP/1.1 200 OK
Content-Length: 58
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
ApplicationDate: Test with date 4/3/2015 3:35:31 PM
Date: Fri, 03 Apr 2015 19:35:31 GMT
{"messages":[],"result":"All is well 4/3/2015 3:35:30 PM"}
Something in the IIS pipeline is setting max-age. (BTW, testing with SoapUI and Fiddler, no browser issues to complicate things)
I have tried disabling the IIS OutputCache module. I verified using FailedReqLogFiles:
OUTPUT_CACHE_LOOKUP_END
Result 4
Result CACHING_DISABLED
When I change the cache-control headers in code, I see the changes in the Self-Hosted version, but something overwrites the headers in the IIS version back to max-age=60.
HTTP/1.1 200 OK
Cache-Control: max-age=60
Pragma: no-cache
Content-Length: 58
Content-Type: application/json; charset=utf-8
ETag: "3ce2e8b6-4891-496e-8bb7-087590239d6b"
Server: Microsoft-IIS/7.5
ApplicationDate: Test with date 4/3/2015 3:49:19 PM
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 03 Apr 2015 19:49:19 GMT
{"messages":[],"result":"All is well 4/3/2015 3:49:19 PM"}
Here's the controller:
/// <summary>
/// Get "REST" status
/// </summary>
/// <returns></returns>
[ActionName("GetStatusDate")]
[Route("GetStatusDate")]
public HttpResponseMessage GetStatusDate()
{
CommonResponse<string> response = new CommonResponse<string>();
response.Result = "All is well " + DateTime.Now;
HttpResponseMessage responseMessage = Request.CreateResponse(HttpStatusCode.OK, response);
responseMessage.Headers.Add("ApplicationDate", "Test with date " + DateTime.Now);
responseMessage.Headers.Remove("Cache-Control");
responseMessage.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromSeconds(11),
NoCache = true,
Private = true
};
responseMessage.Headers.Add("Pragma","no-cache");
return responseMessage;
}
What is setting max-age?
Thanks,
Sean
So, I should have waited another hour before posting the question....turns out the problem was that the CacheOutputAttribute (OutputCache.V2) was not only set on specific resources, but had been added to the global filter collection. Since it inherits from FilterAttribute, IActionFilter, it worked fine as a global filter. That is why all calls were getting cached. It took ripping the project down to nothing to find the issue.
Sean

Firefox's geo.wifi.url's https://www.google.com/loc/json not used?

I used a network sniffer and examined all the requests going out from Firefox when going to http://html5demos.com/geo. According to my Firefox, the geolocation service according to geo.wifi.uri entry is https://www.google.com/loc/json. However I don't see this url in any of the requests.
What am I missing?
I see it in LiveHTTPHeaders:
https://www.google.com/loc/json
POST /loc/json HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b12pre) Gecko/20110220 Firefox/4.0b12pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 42
Content-Type: text/plain; charset=UTF-8
Pragma: no-cache
Cache-Control: no-cache
{"version":"1.1.0","request_address":true}
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Encoding: gzip
Date: Mon, 21 Feb 2011 13:34:05 GMT
Expires: Mon, 21 Feb 2011 13:34:05 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 238
Server: GSE
If your wifi interface is enabled, Firefox sends to Google all the wifi signal strength around you in order to locate you (signals strength,mac addresses and locations of all private and public hotspots were captured by Google with their Street View's cars I guess).
Here is the full POST request captured with TcpCatcher (and its SSL mode)
POST /loc/json HTTP/1.1
Host: www.google.com
Content-Length: 4233
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.119 Safari/534.16
Accept-Encoding: gzip,deflate,sdch
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
{"access_token":"2:fHl0jGoQDeLFKfUn:sn0HJO00jOQV2334","host":"html5demos.com","radio_type":"unknown","request_address":false,"version":"1.1.0","wifi_towers":[{"age":0,"mac_address":"00-13-10-27-ec-ba","signal_strength":-82,"ssid":"linksys"},{"age":0,"mac_address":"00-14-bf-e2-b6-a3","signal_strength":-101,"ssid":"grepre2"},{"age":0,"mac_address":"00-17-33-9e-4d-a8","signal_strength":-94,"ssid":"NEUF_4DA4"},{"age":0,"mac_address":"00-17-33-cc-b5-10","signal_strength":-69,"ssid":"NEUF_B50C"},{"age":0,"mac_address":"00-17-33-cc-b5-11","signal_strength":-66,"ssid":"Neuf WiFi"},{"age":0,"mac_address":"00-17-33-cc-b5-12","signal_strength":-69,"ssid":"SFR WiFi Public"},{"age":0,"mac_address":"00-1a-2b-0e-66-74","signal_strength":-86,"ssid":"NUMERICABLE-AB1B"},{"age":0,"mac_address":"00-1f-33-47-c0-50","signal_strength":-80,"ssid":"SUPERMAN"},{"age":0,"mac_address":"00-1f-33-e0-1e-1f","signal_strength":-80,"ssid":"NUMERICABLE-5866"},{"age":0,"mac_address":"00-1f-9f-f4-1f-17","signal_strength":-90,"ssid":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},{"age":0,"mac_address":"02-81-31-a2-c4-98","signal_strength":-71,"ssid":"wifi"},{"age":0,"mac_address":"02-81-31-a2-c4-99","signal_strength":-69},{"age":0,"mac_address":"02-81-31-a2-c4-9a","signal_strength":-68,"ssid":"FreeWifi"},{"age":0,"mac_address":"02-81-31-a2-c4-9b","signal_strength":-69,"ssid":"freephonie"},{"age":0,"mac_address":"06-20-9f-00-3d-24","signal_strength":-82,"ssid":"damiconexion"},{"age":0,"mac_address":"06-20-9f-00-3d-25","signal_strength":-82},{"age":0,"mac_address":"06-20-9f-00-3d-26","signal_strength":-81,"ssid":"FreeWifi"},{"age":0,"mac_address":"06-20-9f-00-3d-27","signal_strength":-82,"ssid":"freephonie"},{"age":0,"mac_address":"26-b7-bb-70-e1-d8","signal_strength":-93,"ssid":"DC_baby"},{"age":0,"mac_address":"26-b7-bb-70-e1-d9","signal_strength":-91},{"age":0,"mac_address":"26-b7-bb-70-e1-da","signal_strength":-89,"ssid":"FreeWifi"},{"age":0,"mac_address":"26-b7-bb-70-e1-db","signal_strength":-94,"ssid":"freephonie"},{"age":0,"mac_address":"26-f8-5c-ec-bc-a4","signal_strength":-80},{"age":0,"mac_address":"26-f8-5c-ec-bc-a5","signal_strength":-80},{"age":0,"mac_address":"26-f8-5c-ec-bc-a6","signal_strength":-81,"ssid":"FreeWifi"},{"age":0,"mac_address":"26-f8-5c-ec-bc-a7","signal_strength":-80,"ssid":"freephonie"},{"age":0,"mac_address":"30-46-9a-43-fc-e5","signal_strength":-84,"ssid":"DartyBox_98DE"},{"age":0,"mac_address":"32-46-9a-43-fc-e6","signal_strength":-84,"ssid":"DartyBox_98DE_WEP"},{"age":0,"mac_address":"4e-0a-94-3d-d6-38","signal_strength":-82,"ssid":"neko"},{"age":0,"mac_address":"4e-0a-94-3d-d6-39","signal_strength":-82},{"age":0,"mac_address":"4e-0a-94-3d-d6-3a","signal_strength":-80,"ssid":"FreeWifi"},{"age":0,"mac_address":"4e-0a-94-3d-d6-3b","signal_strength":-82},{"age":0,"mac_address":"5c-33-8e-eb-6c-c0","signal_strength":-87,"ssid":"Livebox-0510"},{"age":0,"mac_address":"72-f5-aa-cd-b7-e4","signal_strength":-86,"ssid":"Kermazeguen"},{"age":0,"mac_address":"72-f5-aa-cd-b7-e5","signal_strength":-87},{"age":0,"mac_address":"72-f5-aa-cd-b7-e6","signal_strength":-87,"ssid":"FreeWifi"},{"age":0,"mac_address":"72-f5-aa-cd-b7-e7","signal_strength":-88,"ssid":"freephonie"},{"age":0,"mac_address":"76-a6-a6-5a-90-c8","signal_strength":-78,"ssid":"pipiou_wifi"},{"age":0,"mac_address":"76-a6-a6-5a-90-c9","signal_strength":-79},{"age":0,"mac_address":"76-a6-a6-5a-90-ca","signal_strength":-77,"ssid":"FreeWifi"},{"age":0,"mac_address":"76-a6-a6-5a-90-cb","signal_strength":-78},{"age":0,"mac_address":"86-9c-8f-a0-ac-e4","signal_strength":-78,"ssid":"touhere"},{"age":0,"mac_address":"86-9c-8f-a0-ac-e5","signal_strength":-82},{"age":0,"mac_address":"86-9c-8f-a0-ac-e6","signal_strength":-83,"ssid":"FreeWifi"},{"age":0,"mac_address":"86-9c-8f-a0-ac-e7","signal_strength":-82,"ssid":"freephonie"},{"age":0,"mac_address":"c0-3f-0e-b6-9a-37","signal_strength":-64,"ssid":"NUMERICABLE-825A"},{"age":0,"mac_address":"da-0f-67-af-23-10","signal_strength":-71,"ssid":"freeboxtomseb"},{"age":0,"mac_address":"da-0f-67-af-23-11","signal_strength":-70},{"age":0,"mac_address":"da-0f-67-af-23-12","signal_strength":-71,"ssid":"FreeWifi"},{"age":0,"mac_address":"da-0f-67-af-23-13","signal_strength":-71}]}
google json has stop service.
you can call [minigps]: http://www.minigps.net/map.html "click to query" could use google json api, only change the ip to: http://www.minigps.net/minigps/map/google/location
fllow is the http bytes:
URL:http://www.minigps.net/minigps/map/google/location
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:GBK,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Connection:keep-alive
Content-Length:191
Content-Type:application/json; charset=UTF-8
Cookie:bdshare_firstime=1356366713546; JSESSIONID=68243935CD3355089CF07A3A22AAB372
Host:www.minigps.net
Origin:http://www.minigps.net
Referer:http://www.minigps.net/map.html
User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4
X-Requested-With:XMLHttpRequest
Request Payload
{"version":"1.1.0","host":"maps.google.com","cell_towers": [{"cell_id":"3721","location_area_code":"9779","mobile_country_code":"460","mobile_network_c ode":"0","age":0,"signal_strength":-65}]}
Response Headersview source
Content-Type:application/json
Date:Sat, 12 Jan 2013 06:03:15 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
Note: I'm affiliated with minigps.net.

Resources