How can I include more characters in GET request URL - forms

I want to submit many textareas contents of a form via GET request but it is not allowing me to as GET URL has length restriction. I don't want to use POST for this project as I am using the submitted URL to get contents of the form. So how can I increase the no. of characters in the GET URL?

Since, I didn't hear from anybody, I decided to switch to POST method excluding the feature that I wanted to perform with GET method. I think it is impossible to increase the limit of the number of characters supported by GET method.

Related

Get share/like count for different url/bogposts/articles

I am looking for a method to get share/like count for each of the blogposts/articles which I create on my website. Interested in Facebook, LinkedIn and Twitter but Facebook is the most important right now.
Lets take this website as an example: https://googleblog.blogspot.com/
I have found a method to find this out for each url, but that will make it a lot harder for me as I would need to do it manually for each URL.
This is the query I used to get data for a specific URL:
https://graph.facebook.com/v2.7/?id=https://googleblog.blogspot.no/
Is there any method to get data for each and every url which contains: "company name" or something like this?
Will appriciate all the help I can get here.
No, there is no “wildcard” for Open Graph object URLs.
You can however request data for multiple URLs in one go, using the ?ids=foo,bar syntax – https://developers.facebook.com/docs/graph-api/using-graph-api/#multiidlookup
This theoretically works for up to 50 ids in one request (although with the ids being URLs in this case, you might only be able to request less, due to URL length limitations.)

Why does GET pre-fill data trump POST data, and is there a simple way to reverse this?

In my mod_perl2 app, on one page I link to with ?form_field_name=pre_fill_value tacked onto the URI if I want to pre-fill a particular form field for the user. However, the form itself is just <form method=post>, which posts back to the current page, GET query and all. I expected that Apache2::Request's param() routine would serve up either only the POST data, or the POST data first. Instead, it seems the GET data is given precedence, i.e., the prefill is honoured over the manually-user-fixed data.
The easy fix is to add action= and the current URI without the GET query, but I'm wondering why it was designed this way, and if there's a sneaky way around it, like some mod_perl2 option that would give POST data precedence. However, the easy fix can actually cause problems if un-overridden GET query values are expected to be passed on. So this workaround quickly grows, but why is it even this way in the first place?

Is it a preferred way to reuse a url with different http methods?

For example, when making a payment with credit-card we POST to url /paymybill-cc. And we want to avoid reposting when the user refresh the page. In this case, is it a preferred way to redirect to the same url with GET method?
Usually the POST happens to a url specifying what you want to create, like in your case, but the GET should happen to a url like /paymybill-cc/:id to get a specific one.
If I were allowed to GET /paymybill-cc I would expect it to return all payments, maybe with a default limit, but a lot of them.
If the user reloads the page that contains POST data then he will be prompted about resubmitting his data to the server. See How do I reload a page without a POSTDATA warning in Javascript? for a bit more details on that.

How to retrieve page with special characters in page name

Trying to retrieve general page info using the Facebook graph API using an Jquery/Ajax call. This works flawlessly until I request a page containing special characters or dashes in it's name.
It seems like the special characters are ANSI encoded during the ajax request so the name is malformed and the page cannot be found. I can't find a way though to obviate this.
Example url: https://graph.facebook.com/Musée-de-la-Photographie-Charleroi?access_token=[my_access_token]
Can anybody help me out?
I think you should test different values in contentType parameter. It allows to set char encoding.
Take a look here:
http://api.jquery.com/jQuery.ajax/
It seems like the special characters are ANSI encoded during the ajax request so the name is malformed and the page cannot be found.
No, I don’t think that’s the problem.
As you can see from https://developers.facebook.com/tools/explorer?method=GET&path=18521449287, this page does not have a username set yet – and since it is not accessible via just www.facebook.com/Musée-de-la-Photographie-Charleroi, but only via www.facebook.com/pages/Musée-de-la-Photographie-Charleroi/18521449287 including the page id.
And accordingly, info about the page on the Graph API is only available via the page id as well.
Try using the page_id instead (in this case 131141113604635).
https://graph.facebook.com/131141113604635?access_token=[my_access_token]
You may get this id by opening the page on the browser and pressing Ctrl+U, Ctrl+F and searching for a 'page_id' value.

Send the user to a page along with a error message

I want to set up a login page in which from anywhere on the site I can send a user to it and it will display a custom message along with it. I could use a redirect and a msg query param but is this the best way to do it?
I'm working with node.js but I'm interested in a universal solution.
If you are going for easy, you can just have GET data in the URL. But, that doesn't look that nice, if you want a rather long message, plus, GET has size restrictions, where POST (virtually) hasn't.
For using post data you could use the solution of this: JavaScript post request like a form submit question, but that gives a rather messy source code (if you want a somewhat longer text).
You could keep them in a database, and only send the ID of the message to a PHP page, and get it from the database (that's what I would do, but that doesn't mean it's a good idea, just amateur here!)
You can use jQuery or simply plain javascript to extract your message from the url; the relevant question that listed links to detailed code: jquery get querystring from URL.
Then depending on how you want it displayed, apply the extracted string to your situation.