I am implementing a "POST" api for creating an order through woo-commerce:
POST http://www.url.in/wp-json/wc/v1/orders
I am also using external library Oauth1 for it which uses one-legged authentication for it. Now when I run the API on Postman, it gives me correct response, but in the code it gives me error:
{
"code":"woocommerce_rest_cannot_create",
"message":"Sorry, you are not allowed to create resources.",
"data":{"status":401}
}
In my code I am creating a NSDictionary , I change it to NSData through NSJSONSerialization and sending it as HTTPBody along with the request.
Check the attached screen shot of Postman and Xcode.
[