Can I use GET request instead of PUT to create resources?
Thanks in Advance
Yes. But it will surprise some people, and probably earn you some verbal abuse.
GET requests don't support bodies. So you can create stuff, but not using user input.
Related
I would like to see if anyone else already had this problem. I'm really struggling to find out an solution for that, so that's why I've decided to call for help.
So, i have this Ownbackup API endpoint:
Ownbackup API
Here's the link for the API documentation: https://cdn2.hubspot.net/hubfs/2571574/api%20document-1.html#tag/Enhanced-Sandbox-Seeding/paths/~1api~1v1~1sbs~1templates~1{template_id}~1seed/post
But for me it wasn't too helpful.
The point in here is that my organization has hundreds of validations rules. And I would like to know if there is any parameter that this API understands in order to disable ALL validation rules, without the need of passing the name of each one of the file names in the request body.
Keep in mind that the format for this request is multipart/form-data.
Thank you all!
So, I've reached out for Owbackup support and they told me that i can actually use "disable_validation_rules" set to true, so this way the All validation rules get disabled and the triggers not, also it does not require me to specify which validations rules should be disabled.
I'm letting this answer in here, in order someone else comes across this problem!
Cheers!
So I know this is crazy from a security standpoint, but let's say I have a posts resource at /posts/ and I'd like an admin to be able to trigger a transformation on the collection (in this case, a simple data migration).
How should I design the URL for something like that? It's basically a remote procedure: "take all the posts, modify them, and save them", which is why it is hard to shoehorn onto REST.
I ended up just doing POST /posts/name-of-transform. It's going to be hacky either way :(
So what you want is to update a collection right?
I think what you're looking for is the http PATCH method. It will acte pretty much like your POST method but instead of creating the ressources it will update them.
You can find more about the PATCH method at this address : https://restful-api-design.readthedocs.org/en/latest/methods.html
I've written a HIT on mturk asking people for domain suggestions. Is there any way to ensure that the domain has valid syntax at the time of entry or submission?
So it turns out you can embed an iframe within the HIT. This allowed me to embed a form which I could then validate in any way I pleased. It requires the worker to copy the result of the form into the HIT form.
I think to do this the 'proper way' (i.e. no need to copy-paste) you'd need to use an ExternalQuestion. This can be done via either the API (various languages) or the command-line client.
Is it possible to construct a url to adwords web application?
If I know the account and campaign that I want to visit on AdWords, is it possible to construct the url for it?
It seems to have this pattern:
https://adwords.google.com/billing/ui/app?id=number_for_id&v=number_for_v&__u=number_for_u&__c=number_for_c#PAYMENT_OPTIONS
what's id, __u and __c?
Any help will appreciate.
Thanks,
Raj
Nope, this isn't possible. The pattern you noticed is probably correct, but __c and __u are undocumented parameters that the site uses IMO and Google hasn't documented on what these parameters are or how to generate them.
Cheers,
Anash
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.