Hot answers tagged

9

Many APIs include a version number in the url of the service. Some examples: https://api.twitter.com/1.1/statuses/home_timeline.json https://graph.facebook.com/v2.2/me/adaccounts https://vision.googleapis.com/v1/images:annotate?key=YOUR_API_KEY https://maps.googleapis.com/maps/api/js?v=3.29 https://westeurope.api.cognitive.microsoft.com/vision/v1.0/analyze ...


4

Boto3 is a client for AWS API, so by definition it doesn't handle the synchronous or asynchronous behavior of the API call, that's the API endpoint which define that. You can safely assume that any API endpoint marked as asynchronous will be asynchronous in any API client. Some SDK implement methods to wait for those asynchronous calls, some don't and you ...


3

I pulled this from the Firefox Chef cookbook (in particular this .rb file). This an example of the request they use to get the latest version based on OS and language. https://download.mozilla.org/?product=firefox-latest#&os=win#&lang=#en-US It adheres to the following format: https://download.mozilla.org/?product=firefox-{VERSION_NUMBER}#&os=...


2

You do not want to be parsing HTML in a programmatic way. Avoid it at all costs, if you can. It would be a nightmare to support on-going. There's actually a JSON output that Mozilla provides of all the versions: https://product-details.mozilla.org/1.0/firefox_versions.json Edit: Here is a simple bash script example that will always return the latest ...


2

From my understanding of the docs, you should directly send an array (which is valid JSON), without wrapping it in an object. That is ["bug"] instead of {"labels": ["bug"]}. So, the proper request should be: curl -X POST -u githuser:gittoken \ https://api.github.mycompany.com/repos/team/repo/issues/560/labels \ -H "Content-type: application/json" -...


2

Try this: # Get status curl http://localhost:8081/nexus/service/local/status # List of repositories curl http://localhost:8081/nexus/service/local/repositories For the json parameter: curl -i -H "Accept: application/json" <url> More information, see this link


2

Typically you authenticate API calls (I assume you mean HTTP REST API; there is also a Groovy API) using an API token. The API token can be generated from a user's profile page while logged in as that user (Profile page > Configure > API Token). More information about generating and using API tokens is available in the official documentation. There is ...


2

Did you try the variable ServerlessRestApi? It works for us like this: Outputs: EncryptURL: Description: "Encrypt endpoint URL for Stage environment" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Stage/encrypt"


2

Got it working by aws curl https://github.com/okigan/awscurl awscurl --service iam 'https://iam.amazonaws.com/?Action=ListUsers&Version=2010-05-08'


2

Get the latest version of Tomcat: $ curl -s 'https://api.github.com/repos/apache/tomcat/tags?per_page=1' | jq -r .[].name 9.0.20 Get the latest version of Tomcat 9: $ curl -s 'https://api.github.com/repos/apache/tomcat/tags?per_page=100' | jq -r '.[] | .name' | sort -V | grep ^9 | tail -n 1 9.0.20 Get the latest version of Tomcat 8.5: $ curl -s 'https://...


2

Try directly accessing https://my-api-lb-111222333.us-east-1.elb.amazonaws.com from your web browser and you'll get a similar error. The SSL certificate is not just used for encryption -- it also verifies that the host is not an impostor, by being consulted in a check of whether the hostname used to access the target matches the hostname of the certificate ...


2

List workflow runs would be the equivalent API endpoint in Github Actions: GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs You can use the status query parameter e.g. to filter for successful runs: GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs?status=success


1

I'm not sure I understand what you're trying to do, but .. DataDog has a Docker Intergration, which when configured provides a status of every single container on a host. Then, by simply querying the DataDog metrics, you can see if a particular container is up or not, or how many containers you have available per image, or what's the CPU consumption etc.


1

I'd make the invocation safe, use some try/catch on the invocation itself. That way, if the API is unreachable or HTTP error code is returned - the app can handle it and present the "error" to the user in a more UX-y way ;) Second thing, I'd make a returned data validator of some sort. For example data types, structure etc. Especially on key fields....


1

It should be fine to run the API Gateway on the same server as API-apps - for smaller setups. For larger setups when you need more servers may make sense to use dedicated nodes for API Gateways. API Gateways are increasingly playing a dual role as an application load balancer, or Level 7 Proxy for your APIs - those have a specific role when it comes to ...


1

You could have a separate API gateway for that kind of traffic. Check out the "Variation: Backends for frontends" section of the following article: https://microservices.io/patterns/apigateway.html


1

You can test basically any rest api call from postman, a free app that runs perfectly well in windows or Linux (or Mac I’m sure). You don’t need anything special. If you want to use Linux specific tools, you can sign up for AWS free tier and make a Linux box in minutes following any of their tutorials (it will be free for 1 year). You can also use docker ...


1

There is no difference on vsts for your test (unit, integrated or functional). You just set the right dll name with your tests: or select Test plan if you have a test plan with associated test recordings


1

http://api.releasesoftwaremoreoften.com/latestversion?name=oraclejdk8 http://api.releasesoftwaremoreoften.com/latestversion?name=oraclejdk9 Running: curl -s http://releasesoftwaremoreoften.com/latestversion?name=oraclejdk9 | jq .latestVersion returns: 9.0.4 and curl -s http://releasesoftwaremoreoften.com/latestversion?name=oraclejdk8 | jq ....


1

Using Powershell's Invoke-WebRequest cmdlet: $Links=$(Invoke-WebRequest -Uri 'https://tomcat.apache.org/download-80.cgi' | Select-Object -ExpandProperty Links) $($Links | Where-Object -Property href -Match '#8.5.[0-9]+').href.substring(1) Returns: 8.5.54 This command works on Windows/Linux/MACOS


Only top voted, non community-wiki answers of a minimum length are eligible