question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating pages/posts with large amount of copy throws error

See original GitHub issue

I am trying to save a large chunk of data to a post via API, but I am getting an error:

Unhandled rejection Error: URI Too Long
superagent/lib/node.index.js:688:17
superagent/lib/node/index:js:911:12

I printed a few things to the console and noticed that all API requests are GET requests. Looking at the API documentation (and as a REST library), it should be using the POST & DELETE request types for creating, update and delete.

http://v2.wp-api.org/reference/pages/ http://v2.wp-api.org/reference/posts/

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
kadamwhitecommented, Mar 21, 2016

Thanks, I understand the issue but I need to look into why it wouldn’t be sending things by POST. I will investigate.

0reactions
nbyloffcommented, Mar 22, 2016

Ugh. I totally see that now. I didn’t read the docs completely. Glancing at the examples looked pretty straight forward for the small test I was doing. But yes, it works as expected now. It even seems to save my custom meta field data in my original example now. Going to see if it saves the actual CSS data tomorrow instead of my test data.

Personally, I’d like the library to mirror the actual commands, paths, requests, etc. you would see in the API, like you currently have in the library. It would make for a pretty simple one to one mapping for an API call to your method(s). Now that I know the last method on the chain is the actual request type and not referring to an internal WP post command, it’s all clear & simple now.

I would tweak your readme file just a little bit for the skimmers like me to make it a little more clear. Make the comment on get, post, put, delete in the beginning of the examples and probably add a couple that aren’t modifying posts.

Again, sorry for the confusion. Had a launch over the weekend and I am getting diminishing returns last couple days. hah.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pandas setting a value on a copy of a slice error when ...
The below code makes the update successfully but its throwing a warning about setting a value on a copy of a slice
Read more >
How to Fix WordPress 404 Errors When the Post or Page Exists
Your pages, posts and custom post types are throwing up 404 errors, but they do exist. Here's the fix that can be done...
Read more >
Getting 'Try again later' on Instagram? How To Fix [11 Ways]
When you get the 'Try again later' error message, you'll see two options: 'Tell us' and 'Ok.' Tap on 'Tell us' to let...
Read more >
Update failed: Could not copy file | WordPress.org
I keep getting this error when I try to to do the update from 1.22.1 to ... When WordPress updates a plugin, it...
Read more >
How the Facebook Algorithm Works in 2023 - Hootsuite Blog
2018: The Facebook new algorithm prioritizes “posts that spark conversations and meaningful interactions.” Posts from friends, family and Facebook Groups were ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found