Erweiterung

HTTP Client

Verbinde dich mit externen Diensten und interagiere mit ihnen über ihre APIs.

Logo
Target Image

Click to watch tutorial video - 03:08

Das GraphQL-Schema verfügt über globale Felder, um HTTP-Anfragen an einen Webserver zu senden und die entsprechenden Antworten abzurufen.

Es unterstützt die Verbindung zu REST-APIs, GraphQL-APIs und generischen APIs und ermöglicht das Abrufen und Dekodieren beliebiger Datentypen (einschließlich HTML, XML und CSV).

REST API: Diese Query verbindet sich mit der WP REST API einer externen Website, um deren Beiträge abzurufen:

query {
  postData: _sendJSONObjectItemHTTPRequest(input: {
    url: "https://some-wp-rest-api.com/wp-json/wp/v2/posts/1/"
  })
}

...und liefert diese Antwort:

{
  "data": {
    "postData": {
      "id": 1,
      "date": "2019-08-02T07:53:57",
      "date_gmt": "2019-08-02T07:53:57",
      "guid": {
        "rendered": "https:\/\/newapi.getpop.org\/?p=1"
      },
      "modified": "2021-01-14T13:18:39",
      "modified_gmt": "2021-01-14T13:18:39",
      "slug": "hello-world",
      "status": "publish",
      "type": "post",
      "link": "https:\/\/newapi.getpop.org\/uncategorized\/hello-world\/",
      "title": {
        "rendered": "Hello world!"
      },
      "content": {
        "rendered": "\n<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!<\/p>\n\n\n\n<p>I&#8217;m demonstrating a Youtube video:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Introduction to the Component-based API by Leonardo Losoviz | JSConf.Asia 2019\" width=\"750\" height=\"422\" src=\"https:\/\/www.youtube.com\/embed\/9pT-q0SSYow?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><figcaption>This is my presentation in JSConf Asia 2019<\/figcaption><\/figure>\n",
        "protected": false
      },
      "excerpt": {
        "rendered": "<p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing! I&#8217;m demonstrating a Youtube video:<\/p>\n",
        "protected": false
      },
      "author": 1,
      "featured_media": 0,
      "comment_status": "closed",
      "ping_status": "open",
      "sticky": false,
      "template": "",
      "format": "standard",
      "meta": [],
      "categories": [
        1
      ],
      "tags": [
        193,
        173
      ]
    }
  }
}

GraphQL API: Diese Query verbindet sich mit der GraphQL API von GitHub, um eine Liste von Repositories abzurufen:

query FetchGitHubRepositories(
  $login: String!
  $githubAccessToken: String!
) {
  _sendGraphQLHTTPRequest(input:{
    endpoint: "https://api.github.com/graphql",
    query: """
    
query GetRepositoriesByOwner($login: String!) {
  repositoryOwner(login: $login) {
    repositories(first: 100) {
      nodes {
        id
        name
        description
      }
    }
  }
}
 
    """,
    variables: [
      {
        name: "login",
        value: $login
      }
    ],
    options: {
      auth: {
        password: $githubAccessToken
      }
    }
  })
}

Generische API: Diese Query verbindet sich mit einem WordPress RSS-Feed und dekodiert das XML in ein JSON-Objekt:

query {
  _sendHTTPRequest(input: {
    url: "https://wordpress.com/blog/2024/07/16/wordpress-6-6/feed/rss/?withoutcomments=1"
  }) {
    body
    rssJSON: _strDecodeXMLAsJSON(
      xml: $__body
    )
  }
}

All-Inclusive-Paket kaufen

Personal
$79
/Jahr
“All-Inclusive” Paket
Lizenz für 1 Domain
Kaufen ->
  • 1 Domain
  • Support
  • Produktaktualisierungen
Organization
$99
/Jahr
“All-Inclusive” Paket
Lizenz für 3 Domains
Kaufen ->
  • 3 Domains
  • Support
  • Produktaktualisierungen
Professional
$199
/Jahr
“All-Inclusive” Paket
Lizenz für 10 Domains
Kaufen ->
  • 10 Domains
  • Support
  • Produktaktualisierungen

Die Lizenz gilt für 1 Jahr (jährlich verlängerbar). Die Preise sind in USD.

Brauchst du mehr Domains? Kontaktiere uns

30 Tage Geld-zurück-Garantie

Kaufe jede Erweiterung mit der Gewissheit, dass du eine Rückerstattung anfordern kannst

Testimonial image

“This plugin is next level!. It takes your site to a whole new level and turns it into a powerhouse. The more you explore what it can do, the more impressed you’ll be. If you’re on the fence—just grab it, you’ll kick yourself later if you don’t!. The documentation speaks for itself and is solid as it gets. Leo (the dev) is one of the sharpest and most switched-on developers I’ve ever come across. He’s super responsive and clearly knows his stuff. I’m honestly stoked with how much this plugin can do. The possibilities are pretty much endless, and if SEO matters to you, this thing will help your site rank hard.”

olmate - Webdev

Abonniere unseren Newsletter

Bleib über alle Updates zu Gato GraphQL auf dem Laufenden.