Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use POST with translate API #287

Closed
cedricziel opened this issue Dec 9, 2016 · 5 comments
Closed

Use POST with translate API #287

cedricziel opened this issue Dec 9, 2016 · 5 comments
Assignees
Labels
api: translation Issues related to the Cloud Translation API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@cedricziel
Copy link
Contributor

Same problem as in #250 : Large chunks of text won't go well when submitted through GET requests.

Is there anything stopping us from using the POST method in general when grabbing translations?

@jdpedrie
Copy link
Contributor

jdpedrie commented Dec 9, 2016

I'm trying to determine what needs to happen in order for us to update from GET to POST. In the meantime, you can still use that modified schema definition that @dwsupplee supplied in the previous issue.

I'm sorry this is still outstanding. We are aware of it and trying to get it resolved as soon as we can.

I'll keep this open for tracking the solution.

@jdpedrie jdpedrie added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: translation Issues related to the Cloud Translation API. labels Dec 9, 2016
@cedricziel
Copy link
Contributor Author

Thank you for your quick reply and further investigation @jdpedrie !

If it was just about me, I think i would use the modified schema, but I cannot expect users of a CMS to download and modify a json scheme from a gist. :-/

@jdpedrie
Copy link
Contributor

jdpedrie commented Dec 15, 2016

@cedricziel #289 should help you. You can provide a service definition json file in the factory or in the TranslateClient constructor like so:

<?php
use Google\Cloud\ServiceBuilder;

$cloud = new ServiceBuilder();
$translate = $cloud->translate([
    'serviceDefinitionPath' => '/path/to/modified/service-definition.json`
]);

Be careful when using this, as we can't guarantee future changes won't break with a custom definition file, but when you're sure a service definition will work, it may let you get your hands on certain features before they're supported in the main library.

It'll be included in the next release.

@jdpedrie
Copy link
Contributor

Hey @cedricziel. We just tagged v0.20.1, which includes the change I described above. Hopefully this'll be helpful for you until we're able to officially support the POST http verb.

@cedricziel
Copy link
Contributor Author

Thanks for taking care @jdpedrie !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: translation Issues related to the Cloud Translation API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants