Here Traffic information in the form of JOSN format - api

Is there any we can get the traffic information in the form of json data, because currently here api gives response in the form of png image which is difficult to process.
Below one is the traffic request of Here api
https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/14/8683/5379/256/png8?apiKey=xxxx&min_traffic_congestion=heavy
Reference : https://developer.here.com/documentation/map-tile/dev_guide/topics/example-traffic.html

You can use Traffic Rest API and it returns data in XML or JSON. More details -> https://developer.here.com/documentation/traffic/dev_guide/topics_v6.1/resource-parameters-flow.html

Related

Data storage after API call form Postman/SoapUI

I need to create an automated test-setup for some webservies, and plan to use SoapUI or Postman for that. My question is pretty basic. What happnds to the data after a request is made?
E.g. if the response contains data from a system, and display it in the Postman UI, will Postman store the response? Or what will happnd to it after the request?
I'm asking for security purpose and I was not able to find a concrete answer myself. Thank you in advance.
Postman provides us the explicit ways to store data or not. When you try to run a collection then in the settings we can specify if we want to store responses, cookies, etc or not. Configure it as per your need.
As per the official site
"Postman does not track any content of your requests/responses."
Under File--> settings
You can even avoid using the cloud version if you don't want to sync up things
Re SoapUI...
If you call a service once, then the data remains in the UI. If you run a second or third time, then only the last response is shown in he UI.
Once you close SoapUI, the request and response data is gone.
However, you can save the data from every request and response by using a datasink step, should that be what you want.

Consuming TFS Web Hooks (Post via HTTP)

Is there a specific request format that the webhooks have? I am using the Pull Request Updated event, and I am trying to deserialize into a class, but I do not know what fields I will need. Is there a class or example of the request content details for the different events?
As far as I know, there isn't a generic template for the HTTP post request/response from TFS.
The TFS HTTP post JSON request/response format is based on the specific action.
For example, for the web hooks whenever a work item is updated.If I update a description field, I am getting one format and if I add a child work item, I am getting another format.
However for the specific event, you can check the response format, then get the useful information which you needed.
Please refer to Send JSON representation to a service for more information.
And at the end of the Q&A part there is a sample JSON.

Get request headers to validate analytics in a website

I have to perform testing through selenium webdriver(java) on Site analytics of a website. All the attributes, values are sent to the analytics toold via URL header request. I would like to capture the request alone so that I can perform my manipulations and extract the attributes and their values.
I tried BrowserMob tool. It's getting me the entire traffic in the form of HAR file. is there a way to extract the request alone?
I tried server.setCaptureHeaders(true); but it didn't help much as I see a whole bunch of URLs in the HAR. I'm interested in only one that is sent to the analytics website. There is a URL thats sent as a request behind the scene. Few analytics plugin are able to exactly get the request URL and extract the attribute values but I can't automate through those plugins.
Or is there a way to rip off only certain requests from HAR?
BMP is a great tool. You can only create a new har before the request is sent and read it after this. You can iterate through the dict it returns and find the request you need

OAuth 1.0 binary data upload with RESTful api

I have a DESKTOP application which interacts with a web service through their RESTful api and OAuth 1.0. I can use all the resources fine, authentication, get/post calls to retrieve and send simple text data etc, no problems there.
However, I'm struggling to send binary data. The service allows sending pictures. For one part, they have a non-OAuth api through which you can also send a file in plain binary, simply pass some params in the URL and put the entire binary file in the post.
Now to do this through the OAuth api, becomes an issue:
The service specifies the post needs 2 parameters (not to be included in the URL since this is REST, but in the POST parameters):
image A binary file, base64 data, or a URL
type The type of file that's being sent in. Accepted values: file, base64, url
So we have 2 parameters: image contains the file itself, and type would be "file" to specify binary. But how am I supposed to include this through OAuth? given that the -image- and -type- parameters (and their values) must be used to generate the base string for the signature, which is matched against the parameters included in the POST.. I can't include the entire binary there as a value for the image parameter; so how is it done in this case?
nvm, their OAuth api expects the file as multipart/form-data with the variables there, and none in the base string for the signature (their non-OAuth api instead doesn't need multipart, so I expected their OAuth wouldn't either; their documentation is a bit lacking in this area).

How to get OSM xml or json data from an url?

I have been working on twitter api and found it easy to get json/xml feed from an url like
http://twitter.com/friends/ids.json?screen_name=Planemad&jsoncallback=?
similarly i wanted to know if there is a way to get OSM json/xml data from an url and use that and use it on an OSM map....
http://wiki.openstreetmap.org/wiki/OSM_Protocol_Version_0.6
There is possibilities to read data in specific bounding box (however not too much).