d3v-null / wp-api-python

A Python wrapper for the WooCommerce API.
MIT License
141 stars 34 forks source link

Allow a wordpress api request to specify certain status codes it want… #12

Closed december1981 closed 5 years ago

december1981 commented 5 years ago

…s to allow/handle in response.

There are many cases where I might decide eg a 400 response is helpful - I have an import script for which it's more convenient to try and post something, and handle a 400 - telling me the item is already there, from a previous run of the script... rather than querying if it's there then posting only if it's not (which may be on average a slower process especially on the first run.)

december1981 commented 5 years ago

If you approve this modification, I'll update the readme if you like, as part of this.

codecov[bot] commented 5 years ago

Codecov Report

Merging #12 into master will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   85.96%   85.97%   +0.01%     
==========================================
  Files           5        5              
  Lines         755      756       +1     
==========================================
+ Hits          649      650       +1     
  Misses        106      106
Impacted Files Coverage Δ
wordpress/api.py 72.58% <100%> (+0.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 60fec3f...1326d89. Read the comment docs.

d3v-null commented 5 years ago

Hey there, thanks for the PR, especially since it includes tests!