It's actually a great restApi program, you can chain requests so you can log in then pass the response to another request.
You can have multiple environment ments so you can have one set of routes that will change their target based on what you pick.
At work I have environments for localhost, our development server and production.
I'm not sure if it's electron based but I like Insomnia. If you are using vscode Thunder Client or REST Client might be what you are looking for.
For the filtering, you want to look in to jpath. I expect you can find good results if you google "JSON JPath visualizer". I use Insomnia for one specific application (making webservice requests), but it would be clunky for exactly what you're describing.
>again im just copy-pasting this type of URL into the browser URL textbox
Then you can't set headers. Simple as that. Browsers send a pretty specific kind of request when you just use the URL bar, and you have basically no control over the shape of that request except for the URL itself.
You will need a tool designed for what you're trying to do. My personal favorite is called Insomnia, but probably the most popular is Postman.
Python's a nice language for starting with APIs.
If you're a beginner at Python, take a free course from codeacademy or similar just on general Python usage to start. https://www.codecademy.com/learn/learn-python .
Pay particular attention to data structures, lists, dictionaries, tuples, etc. Go over them a few times to make sure you really get them.
Python's Requests, Json and CSV libraries are really handy to learn after.
Get a REST API client so you can better understand data structures - I've been using Insomnia https://insomnia.rest/ - and start playing with public APIs. Get used to authenticating, getting + posting data via REST. Insomnia generates its own code in Python or JS or various other languages, so is a good way to learn.
Once you've got a basic handle on both, start adapting the code your REST client's generated to do different things, request different data, make fields dynamic, iterate over a list you've received from one request to trigger another set of requests etc etc.
Find a mini project to start on that's going to keep your interest outside of working hours. I'm into football so my first mini project with APIs was pulling stats from http://www.football-data.org/index and looking up my team's forthcoming fixtures vs previous results against same team. See what interests you, and see if there's anyone else written tutorials on that particular API.
Hope that helps as a starter anyway.
You could construct a link that calls up another program, which then makes an API call.
https://insomnia.rest/create-run-button
I haven't used this particular feature, but I use Insomnia's REST API client and prefer it over Postman. I think there's a way to construct links/buttons that can be embedded in any site that will open Insomnia and run a request with parameters you embed in the link.
And you might be able to figure out a way to include Obsidian template variables in the URL to dynamically generate requests that pass the note's filename or path.
Now you've got me wanting to try it! Let me know if you get it working. I may give it a try later, as well.
Check out Insomnia. I've found it to be superior to Postman; especially in that it supports NTLM/Windows Auth directly. Even if you don't need that, it has some neat features.
documentation for environments if you haven't seen it yet.
Basically, an environment is where you can define data that you want to use across multiple requests.
If you define an environment like this...
{
"myHeaderValue": "foo"
}
you can reference the property in the request headers with {{ myHeaderValue }}
.
So, I think the answer to your question is that you can't set headers in the environment, but you can reference the environment within a header.
Oh my GOD, I’m sorry to anyone who this offends, but a lot of these suggestions are comically terrible. They’re very prone to user-error, or may just not work at all. If you want a safe testing environment to investigate this in, I suggest using a site like hybrid analysis
It explains what behavior an application exhibits, and if I’m not mistaken you can also potentially extract strings (and by extension potentially a webhook) from it.
I don’t advise taking vengeance by spamming their webhook, but if anything you can always either report it to T&S or delete it using a tool like insomnia
Simply change the request to DELETE, and paste the webhook link, and click send.
> The headers I think are how I build my "schema", so it's how the data from Strapi will be sent over?
No, the headers contain the authentication / datatype / method, etc. The schema will be what ever you setup on the collection in strapi. You wont need rigorous authentication or anything on your express app. It should be hidden. There are ways to lock it down like checking for a Bearer token you set in Strapi, but those are things you can figure out later.
> If I have proficiency in any language it would be JS as well, so I think that would be best for me to handle the HTTP request?
Setup an express app on a public facing server. It will need to have a public URL so Strapi can send it data. Create your web hook and point it at your new express app. Create a route that can accept a post request like this:
app.use(express.json()) // in express 4.16+ this comes included app.post("/", (req, res) => { console.log(req.body) // Call your action on the request here res.status(200).end() // Responding is important })
This will log the body of the request when it is received from Strapi. Next, you'll need to figure out how to get that data into WP.
I would recommend an API testing program like Insomnia (https://insomnia.rest). You'll need to setup authentication in WP for your app, this will require a plugin. Something like this: https://wordpress.org/plugins/wp-rest-api-authentication/ - WP will not let you create posts with out being authenticated.
Next you'll need to use Insomnia (or postman) to test your WP REST api and figure out exactly what it wants to create a post. This is site specific.
https://rudrastyh.com/wordpress/rest-api-create-delete-posts.html
Once you figure that out, you'll need to convert your payload in Express to the WP schema and send it on it's way.
For some reason I couldn't get Postman to use the right cookie.
If you want to use JS, you can do that too.
You'll want something that looks like this (Javascript):
const client = new GraphQLClient('https://www.heb.com/graphql'); client.setHeaders({ 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9', 'Content-Type': 'application/json', Connection: 'Close', Cookie: 'visid_incap_.... (YOUR COOKIE); USER_SELECT_STORE=false; CURR_SESSION_STORE=92', Host: 'www.heb.com', 'User-Agent': 'Paw/3.3.3 (Macintosh; OS X/12.1.0) GCDHTTPRequest' });
const query = gql
query {
shopNavigation {
id
shortDisplayName
displayName
subCategories {
id
displayName
shortDisplayName
}
}
}
;
const x = await client.request(query).catch((error) => console.log(error));
Are you trying to alter what goes up? Like for testing? If so you can right click on the request , copy as curl and then you can import it into a program like Insomnia
https://insomnia.rest/download
Then you can tweak the values in the request & resend it
Reading the title I thought this might have been about the Insomnia REST client: https://insomnia.rest/
But alas. This subreddit is for programmers talking about APIs. I hope you find some solutions for your problem. (I found that melatonine can help, pretty safe an over-the-counter everywhere; but it's not a permanent solution)
I've just been poking at it with Insomnia and it does look like they're doing some sort of complicated bot-prevention—even duplicating the curl from Chrome is being blocked with a 429.
The API is almost certainly going to give you JSON formatted data and you will need to be able to process it and apply it to your website. There are many ways to do this on the frontend and on the backend.
The stack refers to the technology used to power your site / how you wish to integrate the data.
Backend = server side (PHP, node, ASP, Ruby, etc) Frontend = browser (Javascript, HTML, CSS)
To integrate the data, you will need a handful of technologies to achieve your goal.
I would recommend downloading a Restful API tool that will allow you to test what kind of data you'll be receiving: https://insomnia.rest/download
How to use: https://www.youtube.com/watch?v=H16GUC9Svyk
You could do it that way. You could also start with the server side api and have the open API docs generated automatically. Then use swagger or redoc to view. There will likely be some package for the language you’re using if you go down that route. You’ll probably have to add some extra meta data to help the generator figure things out.
My advice is to play around with the petstore examples to try grasp the basics of open api. Then code a simple get endpoint. Add the meta to the end point. See the generated doc. Point swagger ui or whatever to that.
If you do go down the write api doc first route then I recommend insomnia designer.
https://insomnia.rest/products/designer/
Hope that helped/made sense
The problem with this approach is that they generally rate limit or restrict the origin of requests to APIs to prevent mass data scraping like this. I took a look at Western Union's site and they refer to an API on their own domain at this URL: https://location.westernunion.com/api/locations?country=US&q=08889
The parameters being country
for country of course and q
being zip code. I emulated a GET request using a REST client, Insomnia, and got an error. This is without messing around with the request headers though. It's not something that'd be simple to do if you're not familiar with it unfortunately.
The example you posted wasn't so much that the guy found a raw data file, but that he found an unsecured API that just lets you make requests from anywhere. So he was able to scrape all the data into a nice file for that post.
It's about being consistent, understood, predictable and using correct semantics.
You don't have to use put, patch or delete. And I could also build an entire website using only <div>
tags. But how would that cripple the code? The intention? How would it affect future developers, including myself, when reading the code?
If I used a REST client like Insomnia to explore or test your API and I didn't know much about it, I would probably fail because you aren't using conventions like put or delete.
Are you using correct HTTP status codes like 201 Created
, 204 No Content
, 400 Bad Request
and so on? You don't have to, but it's about doing things correctly and in a way that people expect. Have you thought about the principle of least astonishment? Would other developers be constantly surprised by your design decisions?
Use to use ShiftIt, was good for putting windows in different quadrants, halves, or center of screen using hotkeys. Got a new mac and too lazy trying to find unused key combinations that wouldn't conflict with VS Code and others. It worked well
Been having good results with Insomnia, its a Postman alternative
Note: Download Insomnia Core, haven't played around with Insomnia Designer.
Onda probaj pop_os, mislim da će ti se svideti. Što se tiče programa koje si naveo svi su dostupni na Linux-u. Za terminal ti preporučujem Alacritty, a probaj Insomnia kao zamenu za Postman. Mnogo bolji UI, a ako koristiš osnovne funkcionalnosti ima sve (graphQL, curl import, ...). Za mongo GUI klijenta probaj Robo 3T.
Jel si imao nekih problema sa Catalinom što se tiče stabilnosti? Planiram u bliskoj budućnosti da napravim hackintosh virtualku preko QEMU/KVM-a (virtualizacija za Linux gde možeš da proslediš direktno hardver virtualci i dobiješ skoro nativ performance), al mi žao da trošim vreme ako nije 100% stabilan.
Just keep in mind there is already a pretty popular piece of software called Insomnia. Works cross platform too so also on a Mac.
Not that you can’t use the name too. Just wanted you to know.
>Get an API client and build stuff that just spits out JSON. Insomnia and Postman are the PlayStation and Xbox of this domain. Take your pick, then point it at your backend server running locally, hit your routes, and watch all that lovely JSON coming back that you could feed to your imaginary front end. Congratulations, you are now a back end developer.
One of the best comments I read from other subreddit. Thanks for the comments here though.
Get an API client and build stuff that just spits out JSON. Insomnia and Postman are the PlayStation and Xbox of this domain. Take your pick, then point it at your backend server running locally, hit your routes, and watch all that lovely JSON coming back that you could feed to your imaginary front end. Congratulations, you are now a back end developer.
Check out insomnia app, I used it a while back and it worked pretty good. Don't know if it supports your requirements but could be worth checking out.
​
Edit: Reddit had some troubles loading the other comment so i didnt see the above one.
Glad to help. I recommend checking out Insomnia it is like Postman but specialized for GraphQL. You can save queries, store env variables, and use attributes from one response as input for a query/mutation.
Yup that's the way to do it. Check out insomnia.rest -- it lets you make requests to urls and pass in JSON outside of a browser/code to test things out. Try using it to make requests towards APIs to get some practice in
One idea might be a similar approach to how Imsomnia ( https://insomnia.rest/ ) handles free and paid usage. They keep the app free and open-source but add features to let you sync your settings/content across multiple devices. This syncing would only be available when paying though. Or add team functionality so the team "leader" defines the icons and it reflects down to the team members.
It's obviously all quite theoretical but maybe worth thinking about in the long run :) I do believe that the app you're building right now has potential and is a pretty good idea.
There are just some minor design choices that I'd personally change. Nit picking incoming, lol:
In the "+Add" dialog that pops up is a button "Browse Icons". The button itself is raised and makes it kind of the primary action the dialog even though the primary action should be "Create an empty set". Maybe change the "browse icons" to an actual file-input instead of a button? I think you get what I'm after. It's just UX stuff in the end. The "create empty set" button is green, yet your "EXPORT" button in the very bottom right of the programm is yellow/orangish. What is your primary color now? Green should usually be a color when something succesful happened for example after you created the set. The button itself should be yellow/orangish too. My opinion though
Look at the structure of the call. It may not be enough to just hit the URL, with that status there's likely an auth cookie or token included. Try right clicking the call in the developer tools window and copying it as a curl command, that'll snatch headers, body (if any) and all the other relevant details to recreate every detail of the call. For ease of reading and editing, insomnia will parse the curl command and let you save it.
Just go ahead and use Insomnia. It's a better alternative considering it's not MS Store based and has better privacy than Postman. Unless you need testing, and then use Postman.
The simplest way to experiment with api's is to build one that returns simple strings, "Hello World" for API's if you will. So you don't need to call any databases or anything. Then use a REST client like Insomnia to call them.
Then as you get more comfortable you can expand your API to use databases, read files or whatever. Then build a UI as an entirely separate project.
Check out Insomnia. https://insomnia.rest/ It's a rest client. It'll let you test your API endpoints independently of React.
Mostly your React and Laravel work will be separated. We use Laravel + React in lots of projects. The usual flow is:
Work in Laravel setting up the Models and API endpoints, test those with Insomnia to verify they work.
Then we switch to React and just consume the endpoint. We only return to Laravel when we need to add something to the API.
Is there any particular language which you are trying to code this in? Or do you just want the ability to manually trigger this request? Either way, I recommend Insomnia to test out the format of these requests then you can translate that to whichever programming language you want.
Are you able to successfully make the request with curl
or some REST client like Insomnia? I'd try that to make sure their API is behaving properly. Maybe your API key is invalid or their server is having issues. Try making the request another way to see if your code is really the issue.
Just FYI, I'd recommend Insomnia over Postman. I find it has the functionality of Postman with a much cleaner, more intuitive interface. And some extra features that Postman didn't have (no idea if they've upgraded to compete with Insomnia or not).
> There is an analog for XPath for json. Insomnia uses it when viewing result JSON.
Could you post an example of "Insomnia JsonPath" please? I searched for a few minutes, and the only reference I found was on actually a reference to XPath.
At my last job, I used it extensively. My team owned a workflow platform, so everything we offered was in the form of a service.
I ended up getting frustrated at the pain in trying to have it manage keys when I switched between environments, so I started using Insomnia (https://insomnia.rest) instead. Suited my needs way more closely.
Also an excellent tool available for Mac/Windows. Nice thing is you can save requests, I use it for work on my company's API frequently. Supports REST and GraphQL.
When working I use at least 3. The first is for email, calendar, slack etc. Also for distraction time, like reddit, twitter etc. The second is for my editor/IDE (I'm a programmer), chrome with the application, insomnia and db tools. The third is for terminal running logs from docker or other tools that I'm using for work, but not always.
​
Sometimes I need to do other things urgent and don't want to close everything that I'm doing, so I go for the 4th, 5th...
I still don't get the KDE activities. Firefox, for example, always appear on all activities, so I don't get the point of using