Title: Using REST API with Python3 &#8211; no update being made
Last modified: July 18, 2018

---

# Using REST API with Python3 – no update being made

 *  [stephenk289](https://wordpress.org/support/users/stephenk289/)
 * (@stephenk289)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/using-rest-api-with-python3-no-update-being-made/)
 * Hi,
    I’ve been strugging with this for a few hours, and the Support team directed
   me here, even though I have a .Com business account. So I hope this request is
   both appropriate for the forum, and that my explanation is sufficient for advise
   to be given.
 * The Situation:
    I’d like to post some content, from a Python program resident
   on my laptop currently, into an existing page.
 * I have installed the WP REST API – OAuth 1.0a Server, and setup an Application
   Password.
 * I have read the documentation for the REST API (I’m new to that construct) and
   have reviewed advise on the stackoverflow forums.
 * I am able to make HTTP requests, using the Python script, to the page and receive
   responses.
 * The Problem:
    My attempts to update (i.e. put some content on the page) have 
   been unsuccessful. I receive a HTTP200 code but nothing has changed on the page
   itself.
 * The scratchpad code is below.
 *     ```
       user = 'myappuser'
       pythonapp = 'myappuserpwd'
       post = {
               'title': 'First REST API post',
               'status': 'publish',
               'content': '<p>this is the content post</p>',
               }
       url = 'https://mypage.org/'
       url = url + "mypageToEdit"
       r = requests.post(url, auth=HTTPBasicAuth(user, pythonapp), json=post)
       print(r)
       print(r.headers)
       r.close()
       ```
   
    -  This topic was modified 7 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Fixes formatting

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [7 years, 10 months ago](https://wordpress.org/support/topic/using-rest-api-with-python3-no-update-being-made/#post-10504948)
 * Did you try hitting the actual REST API URL?
 * Sending a POST to just “mypage.org” isn’t going to do anything, but sending a
   POST to the actual REST endpoint located at /wp-json/wp/v2/posts/ might do the
   trick.
 *  Thread Starter [stephenk289](https://wordpress.org/support/users/stephenk289/)
 * (@stephenk289)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/using-rest-api-with-python3-no-update-being-made/#post-10505022)
 * Thanks Samuel. I’ve tried a number of constructs with the /wp-json/wp/v2/pages
   end-point but without success. Do you have any steer on how that might look in
   the above code?
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/using-rest-api-with-python3-no-update-being-made/#post-10506363)
 * POSTing to something like _example.com/wp-json/wp/v2/pages_ is what you want 
   to do. I think where the problem lies is in authentication. Using HTTPBasicAuth
   as you are in requests.post() will not do the job. You need to be providing a
   proper OAuth token. Please review [Setting Up and Using OAuth 1.0a Authentication](https://code.tutsplus.com/tutorials/wp-rest-api-setting-up-and-using-oauth-10a-authentication--cms-24797).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using REST API with Python3 – no update being made’ is closed to new 
replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/using-rest-api-with-python3-no-update-being-made/#post-10506363)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
