rest api - Wordpress API standard compliance and specification for external database

Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 5 years ago.

Improve this question

HOW TO CONNECT WORDPRESS WITH EXTERNAL DB SERVER VIA API?

Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 5 years ago.

Improve this question

HOW TO CONNECT WORDPRESS WITH EXTERNAL DB SERVER VIA API?

Share Improve this question edited Sep 11, 2019 at 6:31 george lau asked Sep 11, 2019 at 4:47 george laugeorge lau 32 bronze badges 5
  • I don't understand what what the REST API documentation has to do with writing a "Wordpress API to link up external database.". What are you trying to do here? – Jacob Peattie Commented Sep 11, 2019 at 5:31
  • What you're describing doesn't make a lot of sense: "can write API for our Wordpress 5.x site in order to access this external db server". Where is this API being created? Is the API for you to pull data to your site? If so, the API would not be a WordPress API so the WordPress REST API documentation would be irrelevant. If they're using the existing REST API on your website to remotely insert data to your site, then why are you asking for the documentation. Isn't that their job? – Jacob Peattie Commented Sep 11, 2019 at 5:52
  • I have no idea. It's not at all clear to me what they want to do here. You'd need to ask them. What sent you here? Did they ask you for something? If so, you should share exactly what they asked for, otherwise it's difficult to help. – Jacob Peattie Commented Sep 11, 2019 at 5:56
  • There's just not enough information in that question to understand what you need. You're going to need to discuss with them their requirements in more detail. – Jacob Peattie Commented Sep 11, 2019 at 6:27
  • ok, thanks for replies so far. – george lau Commented Sep 11, 2019 at 6:32
Add a comment  | 

1 Answer 1

Reset to default 0

WordPress has the HTTP API that you could perhaps use to send POST (wp_remote_post) or GET (wp_remote_get) requests to an API, https://developer.wordpress/plugins/http-api/. But you could also use cURL to send the requests, I think.

If the API is developed by you, then it's up to you to decide what kind of arguments the API accepts/expects and what kind of authentication it requires. If it's some 3rd party API, then you need to consult the API documentation to see what is needed to get a response from it and in which form you'll get the response - e.g. is it a JSON response.

Or if you can skip the API and connect directly to the database, then you could perhaps use $wpdb to do it as described here, Using wpdb to connect to a separate database

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745168686a4614790.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信