RequestLenghtRestriction error on HttpGet - asp.net-mvc-4

I have a web application in MVC4 / ASP.NET. Basically what is happening is in my foreach loop, I'm building a list of strings. When that list gets so long and I try to call HttpGet to retrieve that list I get the RequestLengthRestriction error. How can I fix this? Could I just send through javascript instead? If so, how? I'm not sure if I even provided enough information, if not, please let me know.
Thank you in advance.

Sounds like you need to POST that data.

Related

How can I take a generated token from a Test Suite and add it as an Authorization header?

I'm having an issue with a readyAPI project i'm migrating. I'm not a backend-lover so it's quite diff from my perspective, hope you guys have another pov and can give me a hand.
Here's the issue:
From the first TestSuite I got a Bearer token which I use to authenticate in each next service. Problem is that I do not know how to take this token from the first test without setting it manually into the next service's properties. I mean, I want the token to be setted automatically without the need of setting it manually.
Here's how I got the token
I've this groovy script but I do not know how it exactly works (I didn't created it)
So I think that by variables I can get the token from the first test but I'm not really sure on how to adapt it.
I think that I need to add to this variable the "Bearer " words to make it work, but I cannot see the how to.
Sorry if im not being clear, I'll be glad to add any further information if you guys can help me :)
Thank you very much in advance.
what kind of authentication are you using? Are you just retrieving a jwt back from an endpoint?
Depending on the answer, you might be able to create an auth profile to retrieve the token and use it as part of your request test step. It would save you having to manually add the "Bearer :" part to your token.
Might not be a fit, and if not can maybe look at other options
https://support.smartbear.com/readyapi/docs/requests/auth/types/index.html
Well I added a "Bearer " + to the Groovy script that was implemented and then an Authorized test step to the next tests and it worked! :) If anyone need more info about this workaround I'll be glad to share it.

Can't upload new product image backend prestashop

I need a little help here, i hope someone here can help me for a hint or clue.
First of all, I'm not programmer. I'm just web admin who can use cms and basic html.
I was using PrestaShop for my online shop. In the backend, I can't upload new product image anymore.
The error just blank without any sign for me. Here for the screenshot:
I appreciate it, if someone can help me, thanks, and sorry for my english.
#PanjiWiyono This errors don't really give us a quality information, but this is a start. In your JS code should be a ajax query that has an error when converting results to json (first error). You should check what's the exact error that this request is returning by inspecting in browser developer console.
If you detect that the second error is in fact, the response of this ajax query, well now we almost have the problem.
The second error should be related to data size. Check this: Error while sending QUERY packet
Anyway, you should check DbPDO.php class. You can use debug_backtrace function to display the complete stack, but definitly if error is related to a basic PHP class issue you will have not help knowing wich classes are in calling stack.
Good luck.
Simple solution
maybe a extra module is in a conflict with the prestashop core files. go to advanced parameters, performance and disable third party modules and try again.
other option is reupload admin folder with other name and
js folder check again
hope it will work for you

How to get PATCH parameters of REST API in Yii 1.1?

Yii 1.1.16 brought getPatch($paramName, $defaultValue=null) and getIsPatchRequest() to life, but is there a way to loop through all PATCH parameters, without knowing their names? If a user wants to modify his tag line, but nothing else, how am I supposed to know that he wants to change user_tag_line?
Calling getPatch() gives
Missing argument 1 for CHttpRequest::getPatch().
I've solved it by using
CJSON::decode(file_get_contents('php://input'));
Is this safe, should this be used? Are there other ways of going about this?

Sending Data to JS Form from iOS App

The Red Cross has a locator page where you can submit a zip code by means of a form and that runs through a JSP to return contact information for your local Red Cross office.
From an iOS app, I have the user's zip code and would like to run this process and get that contact information back... or at least the appropriate URL to link to. I was hoping I could find some way to pass the zip code by URL but it doesn't look like it's going to be that easy.
Could anyone offer some direction as to how to go about this? I've done some simple things with forms before but I'm not quite sure where to start with this one.
According to the <form> action parameter, that's the URL you have to post your data to:
http://www.redcross.org//portal/site/en/template.MAXIMIZE/ziplocator/;jsessionid=MWwKPvjSWmvz8p4XrRtNLVL0VCTM7fcwfnFnKHpwRhJTnwLMMDcv!-1938881463!-1334769155?javax.portlet.tpst=2bd907ea326f7e9e934afa36c23f78a0_ws_MX&javax.portlet.prp_2bd907ea326f7e9e934afa36c23f78a0_viewID=result&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken&vgnextoid=6d65e821cbdf9110VgnVCM1000002bf3870aRCRD
The field name is zipcode. The AFNetworking documentation is quite okay explaining how to send a POST request. I would also recommend the nsscreencasts series, he has an episode on AFNetworking as well.
I hope this helps. :)
You can use NSURLConnection to execute a post request and return the result, you may have to do some parsing of the result though depending on the format it is returned in.
Here is an example:
http://forums.macrumors.com/showthread.php?t=689884
NSURLConnection documentation:
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsurlconnection_Class/Reference/Reference.html

yii: serve a file when logged in

I have pdf files in a htaccess-protected directory that I want to show to some users in Yii application.
How is best to solve that? I understand it should be done inside Yii, not with a separate script as it needs to check if a valid user is logged in.
Access control filters
You would do your appropriate security checking (user is in group, or has permission or whatever) and then you would use readfile or something similar.
Do you have code already that isn't working? Or did you just need help with what approach to take?
Thanks!
I got some idea from this link:
http://harrybailey.com/2011/07/yii-rewrite-files-or-images-for-download-or-display/
In short: made a new actionfunction into controller and in that function sending headers and readfile.